From bug-octave-request at bevo dot che dot wisc dot edu Wed Feb 27 11:14:13 2002 Subject: Problem with exp-function From: Andreas Helms To: bug-octave at bevo dot che dot wisc dot edu Date: Wed, 27 Feb 2002 18:13:22 +0100 Hello, I found an unexpected behavior of the exp-function: octave:8> exp(-700) ans =  9.8597e-305 octave:9> exp(-750) ans = 0 octave:10> exp(-730) error: floating point exception -- trying to return to prompt I don't know if the floating point exception is a bug in octave or a system specific problem (I'm running octave on a TRU64 system). The following C++ program         #include         #include         int main()         {                 double x;                 double y;                 x = -700.0;                 y = exp(x);                 cout << "x = " << x << " exp(x) = " << y << endl;                 x = -750.0;                 y = exp(x);                 cout << "x = " << x << " exp(x) = " << y << endl;                 x = -730.0;                              y = exp(x);                 cout << "x = " << x << " exp(x) = " << y << endl;                 return 0;         } gives the output:         x = -700 exp(x) = 9.85968e-305         x = -750 exp(x) = 0         x = -730 exp(x) = 0      Andreas          Lehrstuhl Astrophysik mailto:helms at astro dot physik dot uni-potsdam dot de Universitaet Potsdam http://www.astro.physik.uni-potsdam.de/~helms D-14469 Potsdam ftp://ftp.astro.physik.uni-potsdam.de/pub/helms Phone: +49 331 977 1556 FAX : +49 331 977 1107 ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------