Boost logo

Boost Users :

From: Kevin Heifner (heifner_k_at_[hidden])
Date: 2006-02-25 15:12:28


yinglcs2_at_[hidden] wrote:
> You mention "be careful with literal floating
> point comparisons in general.". I thought doing
> float point == comparision is bad. But I am just doing
> less than (<), so i am okay. Is that true?

Depends. If you don't mind d < 0.05 being true sometimes when d
~= 0.05 then you don't have a problem.

Just like with == comparison, your literal double value may not
be represented as the exact literal value.

KevinH

-- 
Kevin Heifner  heifner @ ociweb.com  http://heifner.blogspot.com
           Object Computing, Inc. (OCI) www.ociweb.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net