- commit
- dcb7447a48c2b64bff20f723184671aacb120cf0
- parent
- 80d71a0360e8c126fef16403a6d59dfc612adbae
- author
- Dami <dami.etoile@gmail.com>
| M | docs/ | 23 | +++++++++++++++++++++++ |
| M | docs/ | 11 | +++++++++++ |
@@ -70,6 +70,29 @@ active cell's error and where it came from, e.g.
7070 `#DIV/0! From B3: division by zero in B5/0`, or names the chain of a7171 circular reference.7272 73+## Decimal arithmetic74+75+Like Sheets and Excel, 012 computes in binary floating point, so76+`=0.1+0.2=0.3` is FALSE and `=INT($4.35*100)` is 434. File > Settings >77+Decimal arithmetic (or search the palette for "decimal") switches the file to78+decimal math for money. The status line then says `decimal`, the menu shows a79+check mark, and the setting is saved with the file and can be undone.80+81+| Computed in decimal | Stays binary |82+|---|---|83+| `+ - * /` and postfix `%`; `SUM`, `AVERAGE`; `ROUND`, `ROUNDUP`, `ROUNDDOWN`, `TRUNC` | `^`, `SQRT`, `PRODUCT`, `SUMIF`, `SUMPRODUCT`, statistics, finance, dates and everything else |84+85+Values are still stored as doubles. Each decimal step reads its inputs as the86+shortest decimal that round-trips (what the cell shows), computes exactly87+(division to 34 significant digits) with88+[apd](https://github.com/cockroachdb/apd), and keeps the double nearest the89+result, so comparisons, lookups and formats see `0.3` rather than90+`0.30000000000000004`. Division still rounds: `=1/3*3` is 0.9999999999999999,91+as in any decimal system. Displayed numbers are already rounded to 1592+significant digits, so the setting matters for comparisons, `INT`/`MOD`-style93+truncation and residues such as `=1.1-1-0.1`. Older builds ignore the setting94+and compute in binary.95+7396 ## Functions7497 7598 See [functions.md](functions.md) for all of them, generated from the engine.@@ -50,3 +50,14 @@ reason.
5050 5151 `JEV_LIVE_TEST=1 go test ./internal/jev -run TestLive` asks the real JEV5252 service one question of each kind, using `TYPESAFE_API_KEY`.53+54+## Demo recordings55+56+`demos/` holds [VHS](https://github.com/charmbracelet/vhs) tapes for the57+recordings in the README. `make demos` renders all of them (or58+`make demos DEMOS=jev` for one) into `demos/out/`: full GIFs, PNG stills of59+key moments in `demos/out/stills/`, and smaller GIFs in `demos/out/media/`.60+It needs vhs 0.12+, ttyd and ffmpeg. The JEV tape talks to `demos/fakejev`, a61+local stand-in the target starts on 127.0.0.1, never the real service. On62+macOS, `demos/lib/ttyd` wraps ttyd so Alt+letter reaches the app. VHS has no63+mouse commands, so the tapes use the keyboard.