Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Linus Gasser <ineiti@gmx.net>
To: axp-list@redhat.com
Subject: Re: Floating point on alpha - SOLUTION 1
Date: Tue, 2 Jul 2002 21:37:28 +0200	[thread overview]
Message-ID: <200207021927.g62JRe912800@mx1.redhat.com> (raw)
In-Reply-To: <200207021310.JAA21609@technolust.cx>

Yes,
that did it! OK, it's not nice. I'll try the other alternatives, too. What's 
really not nice, it's a division with a non-initialised double. Not a test... 
F*CK with -miee I can divide by 0 w/o trouble! What the heck is this? I can 
have

double a = 0, b = 1, c = 2;
b = c / a;

Someone wake me up! What is going on here?

ineiti

On Tuesday 02 July 2002 15:10, you wrote:
> Well,
> Adding '-mieee' to your compile flags will solve the FPE however you
> may be better off to cast the comparison to an (int). Testing for
> the positive case doesn't require 64 bits of precision ;-P .
>
> Peter
> > ineiti@gmx.net said:
> > > I have a general question for alphas: from time to time when I try to
> > > compile  a program for my alpha (PC164), I run into problems with
> > > doubles. For example
> > >
> > > {
> > > 	double a;
> > >
> > > 	if ( a ){
> > > 		printf( "love\n" );
> > > 	} else {
> > > 		printf( "peace\n" );
> > > 	} }
> >
> > Ah, well.  If your whole point is avoid a crash, you can always try:
> >
> > #include <signal.h>
> > static void myHandler(int i)
> > {
> >   signal(i, myHandler);
> > }
> >
> > And add this near the start of the main program:
> >
> >   signal(SIGFPE, myHandler);
> >
> > But then again, it might be better to actually fix the code...
> >
> > Cheers,
> > 					Christian
> >
> > _______________________________________________
> > Axp-list mailing list
> > Axp-list@redhat.com
> > https://listman.redhat.com/mailman/listinfo/axp-list




  reply	other threads:[~2002-07-02 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-02 13:10 Floating point on alpha Peter Petrakis
2002-07-02 19:37 ` Linus Gasser [this message]
2002-07-02 20:45   ` Floating point on alpha - SOLUTION 1 Joseph Ashwood
2002-07-02 21:18     ` Chris Eleveld
2002-07-02 22:32       ` Joseph Ashwood
read-only archive

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