On Tue, 26 Mar 2002, Silvio a Beccara wrote:
[pal06] bohnen $ gpc -v Reading specs from /afs/desy.de/user/b/bohnen/.gnu/lib/gcc-lib/i386-suse-linux/2.95.2/specs gpc version 20020304, based on 2.95.2 19991024 (release)
[pal06] bohnen $ uname -a Linux pal06 2.4.18 #1 SMP Tue Mar 5 15:27:45 MET 2002 i686 unknown
AFAIK any floating point unit can be configured to treat 'out of range' FP-numbers (NaNs) as legal infinity/zero values or as errors. I couldn't find any hint about 'NaN' or 'IEEE' in the gpc - units directory to control this behavior. If there is no user control on that, the current behavior of gpc seems to me the best solution. Otherwise one might run into severe mathematical problems without any notification.
Ernst-Ludwig
^^^^^^^^^^^^^^^^^^^ this is garbage, I forgot the value of e
Silvio a Beccara wrote:
I'd be surprised about C compilers since (as Maurice noted) GPC internally just calls the C function and checks errno. Did you actually check errno when trying it in C?
Ernst-Ludwig Bohnen wrote:
GPC currently doesn't do anything special about it and provides no access with built-in methods (yet).
Good point. So I'd tend to leave things as they are.
Frank
Hello,
Good point. So I'd tend to leave things as they are.
how do I run my program, then? I cannot have it stop every time it has to calculate the exponential of something smaller than -1000. This is simply not acceptable. For instance, with FPC I get everything correct. There are no errors - just plain math!
Before I forget: with the C program, I just compiled it very normally, and it gave me no error, just the correct results.
Thanks, regards
Silvio
In article 200203261732.SAA15974@science.unitn.it, Silvio a Beccara abeccara@science.unitn.it writes
Before I forget: with the C program, I just compiled it very normally, and it gave me no error, just the correct results.
Post a small test program in C showing what you did.
On Tue, 26 Mar 2002, Silvio a Beccara wrote:
Dear Silvio, ..plain math with IEEE Standard 754 double precision means that we can NOT trust results of exp (x), where x < ~-745.1 . Any result is simply undefined in IEEE. 'User friendly' systems (returning 0.0) may lead you up the garden path. Your application needs to know how to handle these special cases in order to get correct results. Further operations like '*' and '/' will give misleading results, even though legal in plain math!
Regards, Ernst-Ludwig