Hi Mojicians,
Decimo (formerly DeciMojo) just hit v0.10.0 (compatible with Mojo v1.0.0b1) and can be installed via pixi add decimo. In this release, I tried out something new. Here are the highlights:
- A new REPL mode has been added to the CLI calculator. The calculator can now be installed via
brew install forfudan/tap/decimo. - The
Decimal128(128-bit fixed precision decimal type) has been greatly optimised. - A new
BigFloattype backed by MPFR for arbitrary-precision calculations has been added into the core library.
Let me walk through each.
CLI calculator — REPL and brew install
In v0.9.0 the CLI calculator was a proof of concept with a command-line interface. v0.10.0 adds REPL mode into it. You can now run decimo with no arguments to enter the REPL mode, and then evaluate expressions interactively with line editing, history, and live settings toggling.
One useful design point is the settings system. Any command-line flag you can pass to decimo can also be toggled live in the REPL with a : command, in a very convenient syntax. For example, :50 s hd sets the precision to 50 digits, switches to scientific notation, and uses the “half down” rounding mode.
If the setting is written in-line (e.g. :p 50), the setting is applied on the spot. It it is written as a standalone line, the setting is applied from onwards. This allows to to easily control the precision and formatting of your results.
The decimo calculator can be installed via a Homebrew tap:
% brew install forfudan/tap/decimo
Decimal128 — optimised and feature-complete
Decimal128 is the fixed-128-bit decimal type (up to 28 fractional digits and significant digits). It is the oldest type in Decimo (came with v0.1.0 on 8 March 2025). v0.10.0 gave it both a feature push and a performance push:
-
New methods matching Python’s
decimal.Decimaland IEEE 754:fma()(single-rounded fused multiply-add),__divmod__(),from_decimal(BigDecimal),cbrt(),normalize(),__hash__(),same_quantum(),max/min/clamp,trunc/floor/ceil/fract/signum/unpack,__bool__/__pos__, plus a unifiedto_string(scientific=…, engineering=…, delimiter=…)API. -
Optimised core functions:
add,subtract,multiply,divide,exp,ln,log10,from_string,to_string, etc.
A cross-language benchmark is included in this release, comparing Decimo against Rust (rust_decimal), C# (System.Decimal), and VB.NET, with BigDecimal acting as the high-precision reference. The results show that decimo is as fast as other languages in decimal128 performance and wins in ULP (units in the last place) accuracy.
BigFloat — arbitrary-precision binary float powered by MPFR
This is the new core type in v0.10.0. BigFloat wraps MPFR (the GNU library for correctly-rounded arbitrary-precision floating point) through a thin C wrapper. Every arithmetic, transcendental, and rounding operation is a single MPFR call against a pooled mpfr_t handle:
from decimo import BigFloat, BFlt
var x = BigFloat("2", precision=100)
var y = x.sqrt()
var z = (BigFloat.pi(precision=100) * x).sin()
BigFloat is optional: it requires MPFR/GMP on the user’s system, and you opt in with pixi run buildgmp to compile the C wrapper.
At the current stage, compiling a mojo file with BigFloat is not very convenient because you have to compile the C wrapper first and then build the mojo file with linking against the C wrapper. I wrote a sh script to allow a quick build and run your mojo script via a simple pixi command.
pixi run bf file_name.mojo
This will automatically compile the wrapper and link it for you mojo file.
Other Changes
- New
Rationaltype — exact rational number, stored as a reduced fraction of twoIntegers. BigDecimaloperator semantics are now aligned with Python’sdecimal.Decimal:+,-,*round HALF_EVEN to the default precision (PRECISION = 28); explicit-precisionadd(other, precision=0)/subtract(...)/multiply(...)give callers an exact path.- Error system is improved — concrete
RuntimeErrorand friends replace the catch-allDecimoError; coloured messages with auto-inferred file name and line number; shortened relative paths to preserve user privacy at compile time.
The full changelog can be found at github.com/forfudan/decimo/releases
As always, feedback and issues are welcome on the repo. Happy hacking! ![]()


