sin(x)^2+cos(x)^2 = 1 on different calcs
|
09-26-2018, 07:37 AM
Post: #14
|
|||
|
|||
RE: sin(x)^2+cos(x)^2 = 1 on different calcs
(09-26-2018 05:27 AM)cyrille de brébisson Wrote: However, I have NO clue what might be going on with 1/3 = 0.0101010101... (binary) 1/3+1 = 1.01010101... (shift the mantissa right by 2 bits, loosing one bit at the mantissa end) 1/3+1-1 = 0.01010101... ( one bit is 0 at mantissa end) so the final difference 1/3+1-1-1/3 is one bit. Quote:=100-99.99-0.01 -> 5.1157E-15This case is more complex, because 99.99 and 0.01 doesn't have simple binary representations. The difference 5.1157E-15 has a mantissa with several bits set (more than two). (09-26-2018 06:37 AM)Werner Wrote: Cyrille: =(1-0.99-0.01) -> 8.67362E-18 = 2^-57+2^-59 Maybe excel is cheating when the mantissa has up to 2 bits close to the end. And I'm happy that excel is using binary arithmetic, I never encountered such situations in real life but had to deal with very large and complex spreadsheets to do system simulations, and speed was the main point. J-F |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)