Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Tony Hammitt <thammitt@kc.rr.com>
Subject: Re: What causes a Floating Poing Exception error?
Date: 2000/02/01	[thread overview]
Message-ID: <389736DD.9B1FD844@kc.rr.com> (raw)
In-Reply-To: 876gcd$96v$1@nnrp1.deja.com

"Dr. Unk" wrote:
> 
> I have a few questions that I need to know the answers too, or at least
> some insight.  The questions are about Floating Point Exceptions
> errors.  The reason that I ask these questions is that I compile the
> packages that I download, and if not all, most of them are coded,
> compiled and tested on PC's, not Alphas.  Are FPE's the similar to
> Segmentation fault's?
> 
> 1.  What causes FPE errors?
> 2.  What can be done to fix or prevent them, coding-wise?
> 3.  Same 2 questions but for Segmentation fault's.
> 4.  Does it have anything to do with architecture dependent code or
> system libraries?
> 
> Thanks in advance.
> 
> --
> Take two shots of vodka and call me in the morning.
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

One of the most common causes of FPE errors is using uninitialized
memory within your program.  Something like the following does not
initialize memory, so watch for these:

double *vector;

vector = (double *)malloc( 200 * sizeof( double ) );


Who know what was in the memory before the malloc used it?

FPE's can be architecture dependent, but it's rare since everyone
started using IEEE definitions for floating point types.

Just my $0.02, look at the other posts for further answers.

Regards,

Tony



  reply	other threads:[~2000-02-01  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-01  5:00 What causes a Floating Poing Exception error? Dr. Unk
2000-02-01  5:00 ` Tony Hammitt [this message]
2000-02-01  5:00 ` Alex Rhomberg
2000-02-01  5:00 ` Robert Harley
2000-02-02  5:00 ` Brendan Murray
2000-02-02  5:00   ` Brian V. Smith
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