Proposal: fixing the 'pure' floating point problem.

Walter Bright newshound1 at digitalmars.com
Sat Mar 14 11:41:51 PDT 2009


Andrei Alexandrescu wrote:
> 1. Is it usual to change the FP flags in an application multiple times, 
> or not? (I never changed them, so please be easy on me.)

Given a complex calculation, one might want to know how sensitive the 
result is to roundoff error. Calculating this exactly can be a daunting 
task, but you can get a rough-and-ready estimate of it by running the 
calculation 3 times:

1. with round to nearest (the default)
2. with round up
3. with round down

and comparing the results. I don't really know of any other uses.


> 2. Is one FP flag setup much more often used than others? If so, we 
> could define pure functions assuming the often-used setup and then some 
> impure functions using any other setup.

I'm not ready to face the prospect of two versions of each math function :-(



More information about the Digitalmars-d mailing list