Message-ID: <3B0A660A.7D064520@ma.tum.de> Date: Tue, 22 May 2001 15:13:46 +0200 From: Waldemar Schultz X-Mailer: Mozilla 4.75 [de] (Win98; U) X-Accept-Language: de,en-US MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp To: djgpp AT delorie DOT com Subject: Re: exp() doesn't work ! References: Content-Type: text/plain; charset=iso-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by sunrbg2.mathematik.tu-muenchen.de id PAA01418 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id JAA11409 Reply-To: djgpp AT delorie DOT com Scott Sinclair schrieb: > > Hi > > I hope I'm just being stupid :) but the following code: > > ////////////////////////////// > double x, y; > > y = some_sensibly_small_number; > > x = exp(y); > ///////////////////////////// > > does NOT set x equal to e^y ???? I am using the libraries suplied with DJGPP > version 2.03. > Unfortunately I can't follow the assembler code in the exp.s source file (is > this assembler ?), so I can't fix the error and rebuild my libraries. > Help ????:) > > cheers > > Scott #include #include #include int main() //int argc, char **argv) { double s; printf("%40.20g\n",s); exit(EXIT_SUCCESS); } prints 1.0000000000000031086 what did you expect ? e^0.0 == 1.0 ! -- Gruss Waldemar Schultz. schultz AT ma DOT tum DOT de Technische Universität München, Zentrum Mathematik M1, D 80290 München Tel: +49 (0)89 2892 8226 FAX: +49 (0)89 2892 8228