Casting double to ulong weirdness

bachmeier via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 25 13:00:10 PDT 2015


On Tuesday, 25 August 2015 at 18:15:03 UTC, Ola Fosheim Grøstad 
wrote:

> It is a practical issue in all simulations where you want 
> reproducible results. If D is meant for scientific computing it 
> should support correct rounding and reproducible results. If D 
> is meant for gaming it should provide ways of expressing 
> minimum precision or other ways of loosening the accuracy where 
> needed.  I'm not really sure which group the current semantics 
> appeals to. I personally either want reproducible or very 
> fast...

As long as it doesn't change from one release of the compiler to 
the next, we have reproducibility. In many cases though, 
reproducibility doesn't mean exact reproducibility, at least in 
the old days it didn't, due to floating point issues. You 
generally want to allow for replication of the results using 
other languages, so you have to allow for some differences.

I'm pretty sure Walter has stated the reason that you cannot 
count on exact precision, but I don't remember what it is.


More information about the Digitalmars-d mailing list