20260323 (v0.9.0)
Decimo v0.9.0 updates the codebase to Mojo v0.26.2 and marks the "make it useful" phase. This release introduces three major additions:
First, a full-featured CLI arbitrary-precision calculator (decimo), powered by Decimo's BigDecimal. It includes a complete tokenizer, a shunting-yard parser, and an RPN evaluator with working-precision guard digits, supporting built-in mathematical functions (sqrt, cbrt, root, ln, log, log10, exp, trigonometric functions, abs), constants (pi, e), and configurable output formatting (scientific/engineering notation, digit delimiters, rounding modes, and precision control).
Second, the BigDecimal API is significantly expanded with methods aligned to Python's decimal.Decimal and the IEEE 754 specification, including as_tuple(), adjusted(), same_quantum(), scaleb(), fma(), copy_abs(), copy_negate(), copy_sign(), bit_count(), __float__(), engineering notation, and digit-group delimiters for to_string(). The ROUND_HALF_DOWN rounding mode is added, bringing the total to seven.
Third, Decimo gains Python bindings via Mojo's PythonModuleBuilder, exposing BigDecimal as a native Python extension module (_decimo.so) with a Pythonic Decimal wrapper for seamless interoperability.
⭐️ New in v0.9.0
CLI Calculator:
- Implement an arbitrary-precision CLI calculator with tokenizer, shunting-yard parser, and RPN evaluator, supporting arithmetic expressions with parentheses and operator precedence (PR #170).
- Add built-in functions (
sqrt,cbrt,root,ln,log,log10,exp,sin,cos,tan,cot,csc,abs), constants (pi,e), and configurable output formatting (scientific/engineering notation, digit delimiter, padding, rounding mode) (PR #171). - Improve CLI error handling with token location tracing and ANSI-coloured diagnostic output (PR #178).
- Use working precision (user precision + guard digits) for intermediate calculations to improve result accuracy (PR #182).
BigDecimal:
- Add engineering notation (
to_eng_string()) and digit-group delimiters (to_string_with_separators()) toto_string(), with optional line-width wrapping (PR #172). - Add utility methods:
is_integer(),is_signed(),number_class(),logb(),normalize(),radix()(PR #173). - Implement
as_tuple()returning(sign, digits, exponent), matching Python'sDecimal.as_tuple()(PR #174). - Implement
adjusted(),copy_abs(),copy_negate(), andcopy_sign()aligned with Python'sdecimalAPI (PR #176). - Implement
same_quantum()and add theROUND_HALF_DOWNrounding mode, bringing the total to seven (PR #177). - Implement
scaleb(),fma(),bit_count(), and__float__()(implementsFloatableRaising) (PR #183).
Python Bindings:
- Implement Python bindings via Mojo's
PythonModuleBuilder, exposingBigDecimalas a native extension module_decimo.sowith arithmetic, comparison, and string operations (PR #179). - Restructure
python/to asrclayout withpyproject.tomlfor PyPI packaging (PR #180).
🦋 Changed in v0.9.0
- Update the codebase to Mojo v0.26.2, adopting
byte=slicing syntax,outparameter convention for constructors, and updatedString/StringSliceAPIs (PR #185). - Merge
TOMLMojointo Decimo as the sub-packagedecimo.toml, removing standalone packaging (PR #181). - Rename
exponent()toadjusted()forBigDecimalto align with Python'sdecimalmodule naming (PR #176). - Change default precision of
BigDecimalto 28 significant digits, matching Python'sdecimalmodule default. - Remove deprecated free-function comparison aliases and legacy method names from
BigDecimal(PR #173). - Align
print_internal_representation()output style acrossBigInt,BigUInt,BigDecimal, andDecimal128with dynamic column alignment (PR #169).
📚 Documentation and testing in v0.9.0
- Add comprehensive user manuals for the Decimo library and the CLI calculator (PR #184).
- Add info badges to the README file.