Marvin,
It is not a bug, it's floating point arithmetic on a binary computer. 0.1 can not be expressed exactly in any finite number of binary digits.
If you are using floating point calculations, you should basically
never test for exact equality. You must always do tests taking some epsilon value into consideration. ie
epsilon = 0.00001
? abs( a + b + c + d ) < epsilon
x = something
y = something else...
? abs( x - y ) < epsilon
>Hi I just had a look at this bug, and wanted to warn again:
>
>Try:
>
>clear
>local a, b, c, d,x
>a= -1
>b= -0.1
>c= 1
>d= 0.1
>x= a+b+c+d
>? empty(x) &&The Value should be empty... but FoxPro tells us it isn't
>? x=0 &&This should also deliver a ".f." but it gives us a .t. which is correct
>
>That means...
>
>Be sure not to use empty with unrounded Numeric Values -or-
>don't use empty()