Christopher Cave 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.
Excerpt from the SMSQ/E manual (roughly translated from German): "If x>0 ATAN returns the same result as ATAN(y/x)". In your first example this is atan(0/1) = atan(0) = 0. So the result is correct. In your second example however the whole thing results in a division by zero. Normally a division by zero is undefined but the ATAN routine seems to count on it having a certain value. However my FP functions do return 0 in case of an error which leads to the final 0. Original SMSQ/Es return PI/2. I'll have a look at what can be done. > Similar misbehaviour is shown by > atan2 in C68 (I suppose this is only a wrapper for the > underlying SMSQ module). I don't think so as they use a different fp format. Marcel
