LinuxQuestions.org
Help answer threads with 0 replies.
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, 07: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, 09: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, 04:12 AM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,053

Rep: Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881Reputation: 881
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, 08: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 04:33 AM.
 
Old 05-27-2011, 03: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, 04: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 01:32 PM
floating point exception srkbapanapalli Linux - Newbie 1 03-26-2008 12:38 PM
firefox 2.0 Floating Point Exception (core dumped) error on Ubuntu 6.10 maximum Ubuntu 1 12-28-2006 12:40 PM
LILO 'Floating point Exception' error? fallout Slackware 17 07-27-2006 02:03 PM
Floating point exception error while starting parted drdosman Linux - Software 1 10-27-2004 12:11 PM


All times are GMT -5. The time now is 12:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration