From: "Alexei A. Frounze" Newsgroups: comp.os.msdos.djgpp Subject: Re: exp() doesn't work ! Date: Tue, 22 May 2001 14:37:53 -0400 Organization: Global Crossing Telecommunications Lines: 28 Message-ID: <9eebip$1kqm$1@node21.cwnet.roc.gblx.net> References: <3B0A660A DOT 7D064520 AT ma DOT tum DOT de> <3B0A7EBF DOT 677B5E6B AT ma DOT tum DOT de> NNTP-Posting-Host: 209-130-131-128.nas2.roc.gblx.net X-Trace: node21.cwnet.roc.gblx.net 990556570 54102 209.130.131.128 (22 May 2001 18:36:10 GMT) X-Complaints-To: abuse AT gblx DOT net NNTP-Posting-Date: Tue, 22 May 2001 18:36:10 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com #include #include #include int main() //int argc, char **argv) { double s; s = exp (1e-15); printf("%40.20g\n",s); exit(EXIT_SUCCESS); } gives approx 1 + 1e-15 as expected from the expansion: e^x = 1 + x + x^/2 + x^3/6 + ... everything is correct, just make sure that those small numbers can still be represented by double type and their contribution in your formulas counts, is not lost because of their small value. Good Luck -- Alexei A. Frounze alexfru [AT] chat [DOT] ru http://alexfru.chat.ru http://members.xoom.com/alexfru/ http://welcome.to/pmode/