delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/22/11:00:05

From: Waldemar Schultz <schultz AT ma DOT tum DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: exp() doesn't work !
Date: Tue, 22 May 2001 16:59:11 +0200
Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany)
Lines: 57
Message-ID: <3B0A7EBF.677B5E6B@ma.tum.de>
References: <F6E7432DD437D511AD92009027C3AAC466B52F AT headoffice DOT umgeni DOT co DOT za> <3B0A660A DOT 7D064520 AT ma DOT tum DOT de>
NNTP-Posting-Host: pcritter14.mathematik.tu-muenchen.de
Mime-Version: 1.0
X-Trace: wsc10.lrz-muenchen.de 990543541 15877 131.159.68.151 (22 May 2001 14:59:01 GMT)
X-Complaints-To: news AT lrz-muenchen DOT de
NNTP-Posting-Date: 22 May 2001 14:59:01 GMT
X-Mailer: Mozilla 4.75 [de] (Win98; U)
X-Accept-Language: de,en-US
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Waldemar Schultz schrieb:
> 
> 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 <stdio.h>
> #include <stdlib.h>
> #include <math.h>
> 
> int main() //int argc, char **argv)
> {
> double s;
> 
   s=exp(3e-15);
   ^^^^^^^^^^^^^
oops sorry, I was too eager cleaning the snippet
>  printf("%40.20g\n",s);
>  return 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


sorry for inconvenience.

-- 
 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019