From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,dbd5e8a2d19cc3f9 X-Google-Attributes: gidfee84,public From: Paul A Sand Subject: Re: Inaccurate logarithm in Pascal Date: 1999/03/24 Message-ID: <7daui4$br3$1@tabloid.unh.edu>#1/1 X-Deja-AN: 458401381 References: <7d81qg$soq$1@news.net.uni-c.dk> <36ffa646.349337953@usenet.pa.dec.com> <7dad0r$cha$1@news.net.uni-c.dk> X-Complaints-To: usenet@tabloid.unh.edu X-Trace: tabloid.unh.edu 922287492 12131 132.177.139.166 (24 Mar 1999 14:58:12 GMT) Organization: University of New Hampshire Reply-To: pas@unh.edu NNTP-Posting-Date: 24 Mar 1999 14:58:12 GMT Newsgroups: comp.unix.osf.osf1 "Morten Skaarup Jensen" writes: >(*******************************) >program main(input,output); >var > i:integer; >begin > writeln('ln(2)=',ln(2):20:18); > for i:=1 to 40 do > writeln('i=',i:2,' 2^i=',exp(i*ln(2)):10:2); >end. >(******************************************) Saith the release notes: ``All floating constants are of type REAL in DEC Pascal'' If you change both occurrances of ln(2) to ln(2.0d0) (good old Fortran...) I think you might see double-precision results. (At least I do here.) -- -- Paul A. Sand | I can't decide if I'm bragging or -- University of New Hampshire | complaining. -- pas@unh.edu | (Mary Loveless, rec.arts.books) -- http://pubpages.unh.edu/~pas |