|
- Changed Number interface methods to return errors instead of panicking
- Float64() now returns (float64, error)
- Add, Sub, Mul, Pow, Compare, Bool() now return (Number, error) or (int, error)
- StringNum and Symbol now return errors for unsupported operations
- Added IsString() and IsSymbol() to Number interface
- Removed unused arithmetic.go file
- Updated operations.go, boolean_ops.go, hyper.go to handle errors
- Added constants registry (internal/rpn/constants.go) with built-in math constants
- Added constants_test.go with comprehensive unit tests
- Updated README.md with constants documentation
|
|
- 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
|