[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: works / doesnot work



PureBytes Links

Trading Reference Links

> You could eliminate the rounding error on both programs by using the
> following to round the range value prior to the comparison.
> StructureChk = ((Round( Range, 2 ) = LittleUp)...

To be safe, you probably ought to round LittleUp too.  That way 
you've got the same operation happening on two similar values so the 
resulting rounded values should be equal.  But you're still doing an 
exact equality test on two binary-approximations-of-decimal-values 
which may still cause trouble.

It's probably easier and more reliable to use something like
StructureChk = absvalue(Range-LittleUp) < 0.001;

Gary