That's what I am assuming in my code at the moment, I wasn't sure if Delphi
was inconsistant by returning a rational number in some situations and an
irrational number in others.  You are correct though,
-0.000000000000000000027105 is close enough :-)

Tony Sinclair
Holliday Group Limited
Christchurch
New Zealand


-----Original Message-----
From: Chris Reynolds [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 3 August 2000 20:37
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Trig Functions


As Pi is an irrational number that cannot be truly captured by a floating
point number
and you used it in an expression, I would think -0.000000000000000000027105
was close enough.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Tony Sinclair
Sent: Thursday, August 03, 2000 7:32 PM
To: Multiple recipients of list delphi
Subject: [DUG]: Trig Functions


Hi all,

does someone else see the same result as me?  I have (for example):

Cos(90 * (Pi/180)) // The center bracket deals with the conversion of
degrees to radians.

When I do this in Delphi, it returns garbage like this

 -2.7105054312e-20 // As opposed to 0.

The Sin function returns the correct result of 1. Using 180 with Cos works,
but use 180 with Sin, you get garbage again.  It seems to be where Sin(X) or
Cos(X) hits 0 and it spits the dummy.  Values approaching the limit are
correct.  Any hints?


Tony Sinclair

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to