loyd / fixnum

Fixed-point numbers
MIT License
7 stars 6 forks source link

Optimize i128 layout #40

Open loyd opened 1 year ago

loyd commented 1 year ago

FixedPoint based on i128 promotes to i256 during calculations. It significantly reduces performance, e.g.:

F64p9/rmul (~1e4, Nearest)               1.00      1.9±0.00ns
F128p18/rmul (~1e4, Nearest)             1.00    134.1±0.79ns