summaryrefslogtreecommitdiff
path: root/docs/basic-arithmetic.md
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-24 10:29:48 +0300
committerPaul Buetow <paul@buetow.org>2026-05-24 10:29:48 +0300
commitc2528014a6c621dca9d46eb70a13db9038e8e5d0 (patch)
tree59a5a3ca3ebaddf0abda12f17d27e39cb97ded4c /docs/basic-arithmetic.md
parentf8147b44f2888ac150659dced719813f0641fc3c (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