Hacker News new | ask | show | jobs
by lbussell 1836 days ago
What about a 2-tuple with two numbers, one being the BigInt and one being the exponent. So 1.000054 would be (1000054, -6) = 1000054*10^(-6).

Yours is probably more space efficient though.

2 comments

This is basically floating-point.

IEEE 754, BTW, allows for 10-based floats, but IDK if anybody uses it.

Yours is more space-efficient for real-world numbers.