Skip to content
Prev 32586 / 398532 Next

Numbers that look equal, should be equal, but if() doesn't see as equal (repost with code included)

On Wed, 28 May 2003, Paul Lemmens wrote:

            
I still think you need not to be using ==.  You want something like

if ( abs(mean.b-mean.orig)/(epsilon+abs(mean.orig) < epsilon){

You are effectively using epsilon=0, but epsilon=10e-10 should be
adequate.

	-thomas
Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle
^^^^^^^^^^^^^^^^^^^^^^^^
- NOTE NEW EMAIL ADDRESS