Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* How to get DEC OSF1 floating point behavior?
@ 1997-09-17  1:37 Eric Woudenberg
  1997-09-17  2:38 ` Andrew D. Isaacson
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Woudenberg @ 1997-09-17  1:37 UTC (permalink / raw)


Hi,

I'm a happy Alpha Linux 4.2 user but I'd like to get "normal" Unix
behavior on floating point overflow. This statement:

	double a = 1.0/exp(720);

on OSF1, SunOS, and HP-UX quietly sets a to 0.0. On Linux is causes
an FPE trap, even if I set SIGFPE to SIG_IGN.

Any suggestions for how to get back to the old "silent" behavior?

Thanks,
Rick Woudenberg
-----------------------------------
My test program:

#include <signal.h>
double exp();

main()
{
    double e;

    printf("signal = %d\n", signal(SIGFPE, SIG_IGN));

    e = 1.0/exp(720.0);
    printf("e = %e\n", e);
}

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to get DEC OSF1 floating point behavior?
  1997-09-17  1:37 How to get DEC OSF1 floating point behavior? Eric Woudenberg
@ 1997-09-17  2:38 ` Andrew D. Isaacson
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew D. Isaacson @ 1997-09-17  2:38 UTC (permalink / raw)


Once upon a time, Eric Woudenberg said:
> 
> Hi,
> 
> I'm a happy Alpha Linux 4.2 user but I'd like to get "normal" Unix
> behavior on floating point overflow. This statement:
> 
> 	double a = 1.0/exp(720);
> 
> on OSF1, SunOS, and HP-UX quietly sets a to 0.0. On Linux is causes
> an FPE trap, even if I set SIGFPE to SIG_IGN.

compile with gcc -mieee.  This will probably result in slower code.

See the axp-list archives at
http://www.redhat.com/mailing-lists/axp-list/
for more on this topic; also do a dejanews search in comp.os.linux.alpha
regarding floating point.

-andy

-- 
Andy Isaacson <adisaacs@mtu.edu> <adi@acm.org> / Linux/Alpha, C, Perl, Java
Fight Spam, join CAUCE: http://www.cauce.org  / Ultimate Frisbee, Footbag
http://www.csl.mtu.edu/~adisaacs/            / I speak for noone but myself

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-09-17  2:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-09-17  1:37 How to get DEC OSF1 floating point behavior? Eric Woudenberg
1997-09-17  2:38 ` Andrew D. Isaacson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox