Skip to content
Back to skills

Decomposition 2026 11 05

ASecurity

Нет. Храни деньги в целых копейках (`int64`), а не в `float`. **Мини-граф (3 узла):** 1. **0.01 не представим в двоичном float точно.** Почему важно: каждая сумма уже несёт ошибку. Якорь: `0.1 + 0.2 == 0.30000000000000004`. Когда бьёт: при первом же выводе суммы на экран. 2. **Ошибка копится при сложении и зависит от порядка.** Почему: `(a+b)+c` ≠ `a+(b+c)` в float. Якорь: сверка, где сумма 10 000 транзакций расходится с ожидаемой. Когда: на отчёте или сверке баланса. 3. **`==` перестаёт рабо...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentsjavascriptjava

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add Siririn77/i-have-autism --skill decomposition-2026-11-05 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Decomposition 2026 11 05?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Decomposition 2026 11 05
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/siririn77-decomposition-2026-11-05-138f9b74/badge)](https://www.skillsdirectory.com/skills/siririn77-decomposition-2026-11-05-138f9b74)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
Нет. Храни деньги в целых копейках (`int64`), а не в `float`.

**Мини-граф (3 узла):**

1. **0.01 не представим в двоичном float точно.** Почему важно: каждая сумма уже несёт ошибку. Якорь: `0.1 + 0.2 == 0.30000000000000004`. Когда бьёт: при первом же выводе суммы на экран.
2. **Ошибка копится при сложении и зависит от порядка.** Почему: `(a+b)+c` ≠ `a+(b+c)` в float. Якорь: сверка, где сумма 10 000 транзакций расходится с ожидаемой. Когда: на отчёте или сверке баланса.
3. **`==` перестаёт работать.** Почему: float нельзя сравнивать на равенство, а деньги хочется сравнивать. Якорь: `0.1 + 0.2 != 0.3` → `true`. Когда: в тесте `assert(balance == 100.00)`.

**Что вместо (по убыванию):**

1. Целые минорные единицы: `int64` копеек. Точно до 9 007 199 254 740 991 копеек (~90 трлн руб.).
2. `Decimal` / `BigDecimal` — если нужны дробные курсы и проценты.
3. В БД — `NUMERIC(19,4)` / `DECIMAL`, не `FLOAT`/`DOUBLE`.

**Исключение, которое надо знать:** в JavaScript все числа — `float64`, другого типа нет. `int64` там недоступен; для денег бери `BigInt` в копейках или `decimal.js`. Безопасное целое в JS: 2^53 − 1 = 9 007 199 254 740 991.

Следующий шаг: замени тип поля в модели и схеме БД на копейки-int и добавь тест: 100 транзакций по 1.00 → `sum == 10000`.

Files in this skill

  • SCORE.md6.6 KB
  • answer-estimate_with-skill.md4 KB
  • answer-estimate_without-skill.md3 KB
  • answer-next-step_with-skill.md1.1 KB
  • answer-next-step_without-skill.md2.7 KB
  • answer-no-preamble_with-skill.md2.5 KB
  • answer-no-preamble_without-skill.md2.7 KB
  • cases.json14.4 KB
  • code-edge-negative_with-skill.md2 KB
  • code-edge-negative_without-skill.md2.2 KB
  • comment-says-why_with-skill.md2.8 KB
  • comment-says-why_without-skill.md1.2 KB
  • decomposition-huge_with-skill.md14.3 KB
  • decomposition-huge_without-skill.md9.8 KB
  • decomposition-small_with-skill.md1.4 KB
  • decomposition-small_without-skill.md242 B
  • destructive-needs-confirmation_with-skill.md3.5 KB
  • destructive-needs-confirmation_without-skill.md3.7 KB
  • disagree-first-line_with-skill.md1.9 KB
  • disagree-first-line_without-skill.md1.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.