Problems with INT()

  • Thread starter Thread starter Andy B
  • Start date Start date
A

Andy B

Hi all

Whilst in the process of replying to someone's post, I discovered a problem
with using INT(). (All cells are formatted as General.)

In A1 I have 32.51
In B1 I have =A1-INT(A1) this gives me 0.51
In C1 I have =B1-0.51 this gives me -1.99840144432528E-15

It doesn't give zero, whichever value I use in A1

Why is this?

Andy.
 
Hi Andy!

Excel is commonly reported as getting its maths all wrong with results
that should be equal being treated as not equal.



See the Microsoft Knowledge base articles for full coverage of
difficulties that Excel and all computing programs have with
apparently simple calculations.



It’s a Binary Numbers ‘thing’ and computers all use binary numbers.
You’ll find it covered in various Microsoft Knowledge base articles:

78113 XL: Floating-Point Arithmetic May Give Inaccurate Results

http://support.microsoft.com/default.aspx?scid=kb;EN-US;78113

214118 XL: How to Correct Rounding Errors in Floating-Point Arithmetic

http://support.microsoft.com/default.aspx?scid=kb;EN-US;214118

172911 XL: Incorrect Result Raising 10 to Very Large/Very Small Power

http://support.microsoft.com/default.aspx?scid=kb;EN-US;172911

214373 XL2000: Incorrect Result Raising 10 to Very Large/Very Small
Power

http://support.microsoft.com/default.aspx?scid=kb;EN-US;214373

42980 (Complete) Tutorial to Understand IEEE Floating-Point Errors

http://support.microsoft.com/default.aspx?scid=KB;en-us;42980

Chip Pearson covers the issue at:

http://www.cpearson.com/excel/rounding.htm


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help on a formula 4
Formula 4
If Functions Time 13
Decimal Place goes crazy when using the "&" Sign. 4
Time spreadsheet 3
need formula returning a blank cell 4
Please help with countif formula 4
Simple Average ? 3

Back
Top