Please, help me to solve the problem: <source code> bit Result; float Density; Density = 0.55; if(( Density < 0.54999995) { Result = 0; } else { Result = 1; } While after running this code Result = 0 ?
Look at bits to round for float compare in C51 options. Default is 3.
The default setting for FLOATFUZZY is 3-bits. This means bits are rounded before comparisons. Set this to 0 and you'll get the results you're looking for. Jon
2 Jon, Neil Thank you very mach. All OK!