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
> 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
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
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
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
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