std.math performance (SSE vs. real)

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 28 22:21:52 PDT 2014


On Sunday, 29 June 2014 at 00:16:51 UTC, Walter Bright wrote:
> On 6/28/2014 3:57 AM, Russel Winder via Digitalmars-d wrote:
>
>> Or indeed when calculating anything to do with money.
>
> You're better off using 64 bit longs counting cents to 
> represent money than using floating point. But yeah, counting 
> money has its own special problems.

Maybe if by "money" you mean dollars in the bank.  But for 
anything much beyond that you're doing floating point math.  
Often with specific rules for how and when rounding should occur. 
  Perhaps interestingly, it's typical for hedge funds to have a 
"rounding partner" who receives all the fractional pennies that 
are lost when divvying up the income for the other investors.


More information about the Digitalmars-d mailing list