3 ms·
So you need 10 digits to the left of the decimal and 2 to the right, for 12 total. A Double should be fine.
by o_nate 4y ago
So you need 10 digits to the left of the decimal and 2 to the right, for 12 total. A Double should be fine.
- alimw 4y agoThis seems about right. Work with pennies why not. My very basic test suggests that 1 - 2^(-53) is distinct from 1 in double-land. So if x is the total number of pennies and 2^(-53) * x < 0.5 I can't see why any problem would arise. That's assuming a proper rounding back to integers at the end.