In trying to answer another user's question, I created a prototype workbook using this formula
=INT((C1-INT(C1))*10)
where C1 contains an arbitrary number. (See attachment.) This formula is intended to return the first digit after the decimal point as an integer. And it works, except when C1 contains numbers from 8.2 to 31.2 (inclusive) with only a 2 after the decimal point.
I broke the formula down into multiple formula steps. The error occurs in the final step when applying INT to the integer 2, returning 1. But this only happens in the cases just described. It seems that INT does not see every 2 as the same number.
This may be some obscure binary precision issue, but if you take 0.2, multiply it by 10, then Excel shows it as an integer 2, I would think you are dealing with an exact representation of the integer 2. And the problem only occurs in some cases with a decimal portion of 0.2, but not others.
Anybody ever see anything like this?
Bookmarks