Money type

Guillaume Piolat first.last at gmail.com
Thu Jan 2 23:11:55 UTC 2020


On Thursday, 2 January 2020 at 19:59:09 UTC, Ola Fosheim Grøstad 
wrote:
> On Thursday, 2 January 2020 at 19:25:08 UTC, Ola Fosheim 
> Grøstad wrote:
>> (123*3+50)/100... Or 3.14% of 123 as (123*314+5000)/1000.
>
> So easy to make mistakes with fixed point, should've been 
> /10000...
>

The devil goes even further if you want to account for negative 
numbers :)
Integer rounding is actually kind of hellish vs floating-point 
rounding.


More information about the Digitalmars-d mailing list