Loss of precision errors in FP conversions

Jesse Phillips jessekphillips+D at gmail.com
Tue Apr 19 23:08:03 PDT 2011


bearophile Wrote:

> In Bugzilla I have just added an enhancement request that asks for a little change in D, I don't know if it was already discussed or if it's already present in Bugzilla:
> http://d.puremagic.com/issues/show_bug.cgi?id=5864

Loosing precision on a fractional number seems like it would be a very common and desirable case. For one thing even dealing with real doesn't mean you won't have errors, you really end up in very tricky areas when using float over double would actually cause issue in the program.

I'm not sure if this would be the best avenue to take in identifying possible performance issues with converting FP.

And last, don't forget about significant figures. This suggests it would be better to produce an error when widening since you really don't have the precision of a double or real.


More information about the Digitalmars-d mailing list