|
- 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
|
|
- 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.
|