by .. » Sat Mar 12, 2005 1:53 pm
Precision error.
I used +0.5 as theshold when I need to round a "normal" floating point number(say, 3.4, 1.2, etc.) to integer.
If a floating point number is storing a number, which should be an integer in theory, I will use much smaller theshold like +1e-10. You will get AC by trying different combination of theshold value and ceil() or floor().
Last edited by
.. on Sat Mar 12, 2005 2:42 pm, edited 1 time in total.
My signature:
- Please make discussion about the algorithm BRFORE posting source code.
We can learn much more in discussion than reading source code. - I HATE testing account.
- Don't send me source code for debug.