floating point comparison basics

ed sillymongrel at gmail.com
Tue Dec 3 15:50:32 PST 2013


On Tuesday, 3 December 2013 at 23:17:29 UTC, H. S. Teoh wrote:

Thanks for the reply and the link, it gives me more confidence 
that I'm understanding things a bit better. I finally feel like 
I've opened the lid on the black box of float precision.

I found a great set of articles which I'm working through now.
http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm

It seems that Phobos approxEqual is (one of the) agreed upon 
methods from all sources I've read.  Another involves computing 
the ULPs as integers and comparing those for equality. Both 
approaches are very similar in terms of code though.

Next year I have a whole semester on numerical computing, 
covering floating point numbers, machine imprecision and how to 
deal with etc....I'm determined to ace that subject :D

Cheers,
Ed



More information about the Digitalmars-d-learn mailing list