=(0.5-0.4-0.1) => -2,77556E-17 =(0.5-0.1-0.4) => 0 && expected * next is more interesting =0.5-0.4-0.1 => 0 && not expectedSolution ( partial ! ) is Round() or use a numeric set where associative rule is valid.
CLEAR SET DECIMALS TO 0 SET FIXED OFF Y=0.5 ? TRANSFORM(M.Y-0.4-0.1,"@^") && <=== HERE YOU SEE THE SAME -2,7755575615629E-17 ? M.Y-0.4-0.1 && <=== HERE VFP APPLY A GOOD ROUND() and print 0 * NEXT SHOW BECAUSE I WANTED TO ABANDON VFP X=M.Y-0.4-0.1 && X is zero ? ? M.X && VFP print zero, but you cannot say that x is zero * with TRANSFORM(,"@^") you print the true value ? TRANSFORM(M.X,"@^") && x = -2,7755575615629E-17 * another proof: EMPTY() have a bug, and not ROUND() the variable before to check for zero ? EMPTY(m.x) && OF COURSE .F. ! * DEFINITIVE PROOF IN VFP9: * ON IEEE FLOAT 0 IS ? 0h+BINTOC(0.0,"B") && 0h0000000000000000 * NOW RUN THIS INTO MS SQL AMALYZER : SELECT CAST((0.5E0-0.4-0.1) AS BINARY(8)) * result is 0xBC80000000000000 * !!!!!! IMPORTANT HERE YOU SEE THE TRUE VALUE FOR X, AND IT IS EQUAL TO -2,7755575615629E-17 * the output is specular regarding to CAST of MSSQL ? 0h+BINTOC(m.x,"B") && 0h00000000000080BC * NEXT two line show another way to print not zero directly, * BUT THE IMPORTANT THING IS THAT X is not ZERO ! ? trans(0.5-0.4-0.1,"@^") && HERE VFP APPLY A GOOD ROUND(,) ? trans(0.50000000000-0.4-0.1,"@^") && HERE VFP APPLY A BAD ROUND(,)Cetin, no software bugs, no cpu bugs,