delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/05/22/09:14:34

Message-ID: <3B0A660A.7D064520@ma.tum.de>
Date: Tue, 22 May 2001 15:13:46 +0200
From: Waldemar Schultz <schultz AT mathematik DOT tu-muenchen DOT de>
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: <F6E7432DD437D511AD92009027C3AAC466B52F AT headoffice DOT umgeni DOT co DOT za>
X-MIME-Autoconverted: from 8bit to quoted-printable by sunrbg2.mathematik.tu-muenchen.de id PAA01418
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 <stdio.h>
#include <stdlib.h>
#include <math.h>

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

- Raw text -


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