From: Dido Sevilla Date: 2006-05-18T17:40:18+09:00 Subject: Re: greatest float smaller than 1.0? On 5/18/06, Francis Cianfrocca wrote: > Without knowing your hardware and software, I can only guess, but when you > subtract two numbers that are as far apart as 1.0 and Epsilon, the operation > has a tendency to throw away most or all of the significant digits. The technical term for this unfortunate situation is significance loss, and it has a tendency to make otherwise elegant mathematical formulas behave like pigs when translated to floating point code. See what happens when you try to subtract two floating point numbers that are very close in magnitude, such as 1.234568 and 1.234566. Both numbers have seven significant digits, but their difference 0.000002, has only one. This particularly affects things like the summation of alternating series and recursion relations, and other places where subtraction is often used, such as with the quadratic formula... To anyone out there who is engaged in coding these sorts of things a lot, I would strongly recommend that they at the very least try reading a book like Forman S. Acton's "Numerical Methods that Work" and/or W.H. Press (et. al.) "Numerical Recipes" before they proceed. I've had these kinds of things bite me in the past, developing answers that were totally wrong, even though the formulae in use were apparently correct. And they would have been, had my floating point numbers been arbitrary precision numbers instead! It's issues such as this that usually make it better and safer to use well-tested numerics libraries where they exist rather than rolling your own.