>-2.7105054312e-20 // As opposed to 0.
Cos works in extended precision and I think that limits its
result to 20 significant (decimal) digits.
So if you are expecting 0 but are getting -2.blah e-20
you're within floating point precision of 0
Any time I've written code using float or extended approximations
for splines and stuff like that
"testing for foo = 0" looks like
if Max(foo,-foo)< 1.0e-19 then
and "testing for foo=bar" looks like
if Max( foo-bar, -(foo-bar) ) < 1.0e-19
for some odd reason Max() is overloaded for extended but Abs()
is not otherwise these would be more naturally written:
"testing for foo = 0" looks like
if Abs(foo)< 1.0e-19 then
and "testing for foo=bar" looks like
if Abs( foo-bar) ) < 1.0e-19
ns
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz