Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!feed.xsnews.nl!border-1.ams.xsnews.nl!post-feeder-02.xsnews.nl!frontend-F09-20.ams.news.kpn.nl From: Cecil Westerhof Newsgroups: comp.lang.postscript Subject: Re: -100 0 atan ==> 270 or -90? Organization: Decebal Computing References: X-Face: "(y8cC@tg_12{">GF'UXTW]FHI2wMiZNrnf'1EFQ&O#$m:f#O7+7}kR,v+Pti8=Vi/Z"g^?b"E X-Homepage: http://www.decebal.nl/ Date: Sat, 03 Aug 2013 10:04:54 +0200 Message-ID: <874nb7dwt5.fsf@Aspire.decebal.nl> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:is8zVPRopgy2+YO/nkGdycQpeKM= MIME-Version: 1.0 Content-Type: text/plain Lines: 27 NNTP-Posting-Host: 77.171.42.144 X-Trace: 1375517608 news.kpn.nl 2811 77.171.42.144@kpn/77.171.42.144:39659 Xref: csiph.com comp.lang.postscript:1569 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. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof