Please see below ...
Joe.
-----Original Message----- From: Frank Heckenbach [SMTP:frank@g-n-u.de] Sent: Wednesday, February 06, 2002 12:25 PM To: gpc@gnu.de Subject: Re: Complex_Arctan
da Silva, Joe wrote:
function Complex_ArcTan (z: Complex): Complex; var x, y, a, b, c, d: Real; begin x := Abs (Re (z)); y := Abs (Im (z)); b := 1 - y; d := (1 + y) / 2; if b < 0 then d := -d; b := Abs (b); if x >= b then begin c := b / x; d := d * c - x / 2;
[Joe da Silva]
Perhaps it's impossible to avoid overflow under all conditions? In this case, if Im(z) is large and Re(z) is small, then "d" will overflow here because "c" is now large too. :-/
But that's the `x >= b' case. :-)
[Joe da Silva]
Oops! Sorry, I missed that - I'm coming down with the 'flu, so my head isn't too clear. :-(
It seems that even the wheel was invented in San Diego :-)
[Joe da Silva]
No, it was invented in Australia! See the following! : <G> http://www.theage.com.au/news/state/2001/07/02/FFX0ADFPLOC.html
Nice. I'm surprised, though, that this didn't happen in the US first ... ;-)
Frank
-- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html