Re: The 'Value' of Basic Maths (was: Basic Maths)

2001-01-28 Thread Pierre Sahores
Jacqueline Landman Gay a écrit : > > > Original conundrum... > > > > >Type this in the message box... > > >put 5.45 - 4 = 1.45 FALSE > > > > I am getting flak on the HyperCard mailing list for mentioning MetaCard, > so I suppose I may as well round out my career by mentioning that > HyperCard d

Re: The 'Value' of Basic Maths (was: Basic Maths)

2001-01-28 Thread Jacqueline Landman Gay
> Original conundrum... > > >Type this in the message box... > >put 5.45 - 4 = 1.45 FALSE > I am getting flak on the HyperCard mailing list for mentioning MetaCard, so I suppose I may as well round out my career by mentioning that HyperCard does this math just fine, no errors. So there must be

The 'Value' of Basic Maths (was: Basic Maths)

2001-01-28 Thread Hugh Senior
Original conundrum... >Type this in the message box... >put 5.45 - 4 = 1.45 FALSE So we have a sever dose of the floating point accuracies, huh John? >On the surface, it appears to me that this is an interesting example of how >roundoff errors in computer calculations can cause programming hea

Re: Basic Maths

2001-01-28 Thread Claude Lemmel
Hugh Senior wrote : > put 5.45 - 3 = 2.45 TRUE > but... > put 5.45 - 4 = 1.45 FALSE Same bug on my Pentium based computer. Even put 5.45 - 4.0 = 1.45 FALSE Pentium's or mc's bug ? As a workaround you can use round(myNumber,nDigits) put round((5.45-4),10)-round((1.45),10)=0 TRUE Claude

Re: Basic Maths

2001-01-27 Thread John Kiltinen
Hugh Senior wrote: >Type this in the message box... > >put 5.45 - 1 = 4.45 TRUE >put 5.45 - 2 = 3.45 TRUE >put 5.45 - 3 = 2.45 TRUE > >but... > >put 5.45 - 4 = 1.45 FALSE > >Huh? This is not helping my sanity, nor writing a finance checking routine >that answers false instead of true! > >Any

Basic Maths

2001-01-27 Thread Hugh Senior
Type this in the message box... put 5.45 - 1 = 4.45 TRUE put 5.45 - 2 = 3.45 TRUE put 5.45 - 3 = 2.45 TRUE but... put 5.45 - 4 = 1.45 FALSE Huh? This is not helping my sanity, nor writing a finance checking routine that answers false instead of true! Any answers out there? /H Hugh Senio