internal/calc gets its own tokenizer and precedence-climbing parser in place of go/parser, which cannot express a power operator; go/constant still computes. ^ (also **) binds tighter than * / % and a sign on its left, and groups to the right. % takes the sign of the divisor and is exact on decimals. A whole exponent is computed exactly while the result's numerator and denominator stay within 4096 bits; otherwise, and for a fractional exponent, in float64. A remainder, or the sign of a negative base's power, that depends on a value go/constant holds rounded is refused as too large. The welcome text and the replies mention the new operators; a negative base with a fractional exponent gets its own reply. Model: opus-5-5
This commit is contained in:
@@ -120,7 +120,7 @@ Do not weaken them.
|
||||
```
|
||||
cmd/simplexcalc/ main(), a single call into internal/cli
|
||||
internal/bot/ startup, address setup, and the reply to a message
|
||||
internal/calc/ the arithmetic: go/parser and go/constant
|
||||
internal/calc/ the arithmetic: its own parser, and go/constant
|
||||
internal/cli/ cobra command tree: run and version
|
||||
internal/config/ viper-backed configuration; the abort-on-garbage rule
|
||||
internal/logger/ log/slog, JSON always
|
||||
|
||||
Reference in New Issue
Block a user