LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-16-2009, 06:56 AM   #1
mathb
LQ Newbie
 
Registered: Oct 2008
Posts: 7

Rep: Reputation: 0
Floating point exception error


Hi all,

When i try to run my application on an arm board with linux OS , the application crashes with floating point exception .

Could someone tell me why would a floating point exception occur in general .

Thanks
 
Old 03-16-2009, 08:39 AM   #2
akuthia
Member
 
Registered: Oct 2007
Location: triad, nc, usa
Distribution: Ubuntu
Posts: 232

Rep: Reputation: 29
google is thy friend

Quote:
Also, five types of floating-point exception are identified:

* Invalid. Operations with mathematically invalid operands--for example, 0.0/0.0, sqrt(-1.0), and log(-37.8)
* Division by zero. Divisor is zero and dividend is a finite nonzero number--for example, 9.9/0.0
* Overflow. Operation produces a result that exceeds the range of the exponent-- for example, MAXDOUBLE+0.0000000000001e308
* Underflow. Operation produces a result that is too small to be represented as a normal number--for example, MINDOUBLE * MINDOUBLE
* Inexact. Operation produces a result that cannot be represented with infinite precision--for example, 2.0 / 3.0, log(1.1) and 0.1 in input

The implementation of the IEEE standard is described in the Sun Numerical Computation Guide.
Basically, it looks like it amounts to performing a math equation that your math teacher would've yelled at you in highschool for.
 
1 members found this post helpful.
Old 03-17-2009, 03:12 AM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Isn't it also possible that you have compiled your app with compiler options that assumes there is a floating point processor present and you don't have one on your ARM board? More info on your target hardware, please?
 
Old 05-26-2011, 07:55 AM   #4
niamov
LQ Newbie
 
Registered: Dec 2009
Posts: 10

Rep: Reputation: 0
Hello,

I dig up this old thread : I am in the same situation as mathb 2 years ago :
I try to run my application on an arm board with linux OS and the application crashes sometimes (rare) with floating point exception.
There is a dividing operation in the code, (random division) but I check that it is not a zero divide.
What seems the more probable is "Inexact" type reported by akuthia... But I don't really understand why "Inexact" type is a problem? i.e why making operation 2.0 / 3.0 should crash the application? In my mind the result should just be truncated to 0.6666667 ....

Thanks

Last edited by niamov; 05-27-2011 at 03:33 AM.
 
Old 05-27-2011, 02:12 AM   #5
akuthia
Member
 
Registered: Oct 2007
Location: triad, nc, usa
Distribution: Ubuntu
Posts: 232

Rep: Reputation: 29
In your mind, it does get truncated, a computer doesnt have a "mind" to truncate it, unless it was specifically programmed to do so, thus the error.
 
Old 05-27-2011, 03:36 AM   #6
niamov
LQ Newbie
 
Registered: Dec 2009
Posts: 10

Rep: Reputation: 0
Okay, I made a quick hello world test with 2.0/3.0 operations and with my environment, it is truncated to 0.666667 .
So there is no problem with that.
I found my error which was finally a 0 divide operation not properly managed in a specific case.
Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Floating point exception cccc Debian 0 11-28-2008 12:32 PM
floating point exception srkbapanapalli Linux - Newbie 1 03-26-2008 11:38 AM
firefox 2.0 Floating Point Exception (core dumped) error on Ubuntu 6.10 maximum Ubuntu 1 12-28-2006 11:40 AM
LILO 'Floating point Exception' error? fallout Slackware 17 07-27-2006 01:03 PM
Floating point exception error while starting parted drdosman Linux - Software 1 10-27-2004 11:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration