diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-24 10:29:48 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-24 10:29:48 +0300 |
| commit | c2528014a6c621dca9d46eb70a13db9038e8e5d0 (patch) | |
| tree | 59a5a3ca3ebaddf0abda12f17d27e39cb97ded4c /docs/basic-arithmetic.md | |
| parent | f8147b44f2888ac150659dced719813f0641fc3c (diff) | |
fix(rpn): use NewRatFromString in RationalMode to preserve precision
In pushLiteral, use NewRatFromString(token) instead of
NewRat(ParseFloat(token)) when mode is RationalMode. This preserves
the full precision of the original numeric string by parsing it
directly into big.Rat, avoiding the float64 intermediate that loses
precision.
In ResultStack, replace NewNumber(val, mode) with explicit mode
dispatch for variable references. Note: variables stored as float64
still lose precision at storage time, but the push path is now
consistent.
Diffstat (limited to 'docs/basic-arithmetic.md')
0 files changed, 0 insertions, 0 deletions
