At 02:45 �� 26/2/2002 +0000, you wrote:
>Has anyone else tried to use the arc tangent function in SMSQ or
>in C68? As far as I can see, its marginal behaviour is
>incorrect. If I enter 'print atan(1,0),atan(0,1)' to SBasic, I
>expect to get PI/2,0 NOT 0,0. Similar misbehaviour is shown by
>atan2 in C68 (I suppose this is only a wrapper for the
>underlying SMSQ module).
>
>Shouldn't atan2 be:
>
>double atan2(double y,double x)
>{
> if (x==0)
> {
> if (y>0) return pi/2;
> else if (y<0) return -PI/2;
> else return 0; /* or an OS error */
> }
> else return atan(y/x);
>}
>
>I know this may seem obscure but try working with angles with a
>defective atan(2) function!
>
>Christopher Cave
I have noticed a weird behaviour on ATAN myself unrelated to that. Many
times it returns rounded values instead of decimal ones but I haven't had
time to pinpoint the circumstances yet.
Phoebus