Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zig_decimal

zig_decimal is a standalone Zig decimal arithmetic package extracted from Forge's Zig execution kernel.

It provides:

  • fixed-scale decimal arithmetic with up to 28 decimal places
  • fromF64 conversion tuned to match rust_decimal-style semantics
  • rounding, normalization, division, square root, logarithm, exponentiation, and power helpers
  • a small, importable Zig package surface via @import("zig_decimal")

Quick start:

const dec = @import("zig_decimal");

const price = dec.Decimal.fromF64(76.51) orelse unreachable;
const qty = dec.Decimal.fromInt(700);
const turnover = price.mul(qty);

Run tests with:

zig build test

About

Standalone Zig decimal package extracted from Forge

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages