From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f8351dd592017faf X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!post02.iad01!roadrunner.com!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Ada 95 ARCTAN function References: <1172775505.390886.213420@t69g2000cwt.googlegroups.com> <1172779385.153524.259420@p10g2000cwp.googlegroups.com> From: Keith Thompson Organization: None to speak of Date: Sun, 04 Mar 2007 13:16:57 -0800 Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:rI8B7aQjomT3p15XiqFOr3XV/Oo= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rr.com Xref: g2news2.google.com comp.lang.ada:9669 Date: 2007-03-04T13:16:57-08:00 List-Id: "Adam Beneschan" writes: > On Mar 1, 11:38 am, Jacob Sparre Andersen wrote: >> I don't know where I can find the corresponding specification for the >> C function atan2(), so I can't give you a proper comparison. > > The Unix "man" page for atan2 has some information. It's not as > detailed as the Ada manual, because after all this is C and providing > specific details would infringe on the inalienable right of C > programmers to shoot themselves in the foot. However, the man page > I'm looking at does say: > > (1) that the result is between -pi and pi (inclusive), and > > (2) the signs of both arguments are used to determine the quadrant of > the result. > > So I'd guess that the semantics are probably the same. The C99 standard says: The atan2 functions compute the value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. A domain error may occur if both arguments are zero. The atan2 functions return arctan y/x in the interval [-pi, +pi] radians. -- Keith Thompson (The_Other_Keith) kst-u@mib.org San Diego Supercomputer Center <*> "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"