[BUG] Float atan:

David N. Smith (IBM) dnsmith at watson.ibm.com
Thu Jun 10 16:50:03 UTC 1999


At 17:12 -0400 6/7/99, Alexander Lazarevic wrote:
>Jeff Pierce writes:
> > I actually wrote it that way intentionally.  Since 225 degrees and -135
> > degrees are equivalent, I went with 225 degrees because it eliminates a
> > problem with the interpolation of rotations in Squeak-Alice.
>
>I compared arcTan: with the behaviour of the C function atan2(y,
>x). This one returns values between -Pi and Pi. I found this to be more
>consistent than to return values between -Pi/2 and 3*Pi/2. Ok, maybe I
>shouldn't have called that a bug, but I think this should be commented
>in the method.
>
>Alex.

With my purist hat on, I think that the definition should match the
'standard' definitions in C and FORTRAN and elsewhere. A particular
application can easily add a variant internally or to Number, but making
the basic definition different than what one might expect because one
application needs it makes me nervous.

Purist hat off...

Dave
_______________________________
David N. Smith
IBM T J Watson Research Center
Hawthorne, NY
_______________________________
Any opinions or recommendations
herein are those of the author
and not of his employer.





More information about the Squeak-dev mailing list