From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f9382,ddfd8abfcc735b46 X-Google-Attributes: gidf9382,public X-Google-Thread: 111c93,ddfd8abfcc735b46 X-Google-Attributes: gid111c93,public X-Google-Thread: 111f53,ddfd8abfcc735b46 X-Google-Attributes: gid111f53,public From: Tony Hammitt Subject: Re: What causes a Floating Poing Exception error? Date: 2000/02/01 Message-ID: <389736DD.9B1FD844@kc.rr.com>#1/1 X-Deja-AN: 580470598 Content-Transfer-Encoding: 7bit References: <876gcd$96v$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rr.com X-Trace: typhoon2.kc.rr.com 949434078 24.94.177.74 (Tue, 01 Feb 2000 13:41:18 CST) MIME-Version: 1.0 Reply-To: thammitt@kc.rr.com NNTP-Posting-Date: Tue, 01 Feb 2000 13:41:18 CST Newsgroups: comp.os.linux.alpha,comp.os.linux,development.system "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