std.math performance (SSE vs. real)

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 28 17:16:53 PDT 2014


On 6/28/2014 3:57 AM, Russel Winder via Digitalmars-d wrote:
> I wonder if programmers should only be allowed to use floating point
> number sin their code if they have studied numerical analysis?

Be that as it may, why should a programming language make it harder for them to 
get right than necessary?

The first rule in doing numerical calculations, hammered into me at Caltech, is 
use the max precision available at every step. Rounding error is a major 
problem, and is very underappreciated by engineers until they have a big screwup.

The idea that "64 fp bits ought to be enough for anybody" is a pernicious 
disaster, to put it mildly.


> 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.


More information about the Digitalmars-d mailing list