Hacker News new | ask | show | jobs
by geekpowa 1987 days ago
Rationals are to decimals as arbitrary precision decimals are to binary floats.

Drill the junior devs: use decimals if you want accuracy.

What is unsaid with this: if you want accuracy with monetary representation.

Lots of problems out there where decimals are simply inappropriate.

One day, rational as a core type in postgres would be a nice addition. Rationals should belong as a core type in most every platform where general purpose compute can happen.