[Qt-interest] QString::number question
Constantin Makshin
cmakshin at gmail.com
Wed May 26 21:38:42 CEST 2010
On Wednesday 26 May 2010 22:39:41 Marc Ferland wrote:
> ...
> Am I forced to use a small epsilon to detect when the value is near
> zero?
It's a bad idea to compare floating point values directly (a == b) no matter what is the number you're comparing with. You should always check that the difference between two numbers is less than some very small value (fabs(a - b) < epsilon) to consider these numbers equal.
More information about the Qt-interest-old
mailing list