Warning
•
Do not compare floating-point numbers for
equality. Remember that the binary
representations of floating-point numbers
are approximations. Instead, test for near
equality.
–
Example:
fabs(r – s) < 0.00001