summaryrefslogtreecommitdiff
path: root/internal/rpn/boolean_test.go
AgeCommit message (Collapse)Author
2026-03-25Fix Ln operation and add comprehensive testsPaul Buetow
- Fixed Ln operation to handle Value conversion before math.Log using Float64() which handles boolean conversion (true → 1, false → 0) - Added TestLnWithBoolean and TestLnEdgeCases tests for comprehensive coverage - Refactored operations.go into separate files (arithmetic.go, boolean_ops.go, hyper.go, stack.go, variable.go) - Removed unused toNumber function from number.go - Added Float64() method to Value struct for boolean conversion
2026-03-25docs: Add SPDX license headers to remaining .go filesPaul Buetow
- Added SPDX header to cmd/gt/cli_test.go - Added SPDX header to internal/rpn/boolean_test.go All 27 .go source files now have SPDX license headers with MIT license and copyright notice for Paul Buetow (c) 2026.
2026-03-25feat: Implement boolean operators and mixed boolean-numeric arithmeticPaul Buetow
- Added boolean operators: GT, LT, GTE, LTE, EQ, NEQ - Registered as: gt, lt, gte, lte, eq, neq - Also registered symbols: >, <, >=, <=, ==, != - Added boolean literal support: - true and false are now recognized as boolean values - Can be used in expressions like: true 2 *, 0 false + - Fixed boolean formatting: - Show command now displays booleans as 'true'/'false' - Single result output uses Value.String() instead of toNumber() - Created boolean_test.go with comprehensive tests: - TestBooleanOperators: Tests all 6 boolean operators - TestBooleanToNumberCoercion: Tests automatic coercion in arithmetic - TestMixedBooleanNumericArithmetic: Tests mixed boolean-numeric arithmetic - TestBooleanShowFormat: Tests Show command displays booleans correctly All tests pass and the binary builds correctly.