Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Helge Blischke Newsgroups: comp.lang.postscript Subject: Re: -100 0 atan ==> 270 or -90? Followup-To: comp.lang.postscript Date: Sat, 03 Aug 2013 15:42:18 +0200 Lines: 34 Message-ID: References: <874nb7dwt5.fsf@Aspire.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: individual.net /IBQmvvJsa5odYLJF52tzwui5VcxFitZyaSs19MdBXAzZRPqon Cancel-Lock: sha1:35r920LA20S8ILDVsfIV5/KRb24= User-Agent: KNode/0.99.01 Xref: csiph.com comp.lang.postscript:1573 Cecil Westerhof wrote: > Op zaterdag 3 aug 2013 06:23 CEST schreef luser: > >> I've started writing up a test program for all operators, >> mostly using the example snippets from the manual. >> >> And I've run into a difference between the Red Book (PLRM 1ed) >> and the GNU C library in the value returned by atan. >> >> The Red Book says: >> >> -100 0 atan => 270.0 >> >> But atan2(3) (after suitable conversions) gives me -90.0 >> >> Is this serious? And, if so, what (if anything) should I do about >> it? > > It looks like postscript does a modulo 360. Which in certain > definitions gives a value between 0 and modVal. The funny thing being > that mod gives a value between -modVal and modVal. > > So I would say it is a bug. > The PLRM (3rd ed.) says: atan num den atan angle returns the angle (in degrees between 0 and 360) whose tangent is num divided by den. So the positive value seems to be intentional. Helge