English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

1 answers

One important consequence is that it is not possible to exactly represent some numbers. Where this often shows up is in comparisons. Sooner or later you will get into trouble if you write something like

if (fValue == 3.025)

Instead you have to write something like

if (abs(fValue-3.025) < fThreshold)

where fThreshold is some small value.

2007-09-20 05:06:47 · answer #1 · answered by dogsafire 7 · 0 0

fedest.com, questions and answers