Results 1 to 3 of 3
Hey! I've been using/attempting to use Linux (for the last 3 days) to run some programs for my final year engineering project and I encounter a "Floating exception" when I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-04-2010 #1
- Join Date
- Sep 2010
- Adelaide, SA, Australia
Help! - Floating exception?
I've been using/attempting to use Linux (for the last 3 days) to run some programs for my final year engineering project and I encounter a "Floating exception" when I try and run one of my programs.
I have run a similar program with the only difference being a different input file but the code (written in Fortran 90/95?). but I have changed the code to open the new input data but this error comes up and it quits.
What can I do? has this happened to someone else before?
- 09-04-2010 #2
Floating exceptions are normally caused by incorrect mathematical operations or even when your current computer has another integer/float range which is exceeded by one operation or variable. Please make also sure you don't have any division by zero (which als might result from rounding errors).
But without any further information we can't help you more specifically.
- 09-06-2010 #3
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
Move your question to the "Linux Programming & Scripting" forum. That said, we can't really help with school work/projects in specific ways, but we can at least help point you in the right direction. What Manko10 said was spot-on. A FPE (floating point exception) is usally caused by a divide-by-zero situation, or trying to exceed the resolution of the type in use, though in that case you should get either an overflow, or underflow error, although they may be mapped generically to the FPE by default.
In any case, since this is your final year engineering project, your math must be pretty complex. My suggestion is to decompose the computational components into smaller expressions. In those cases where a divisor may approach or equal zero, then test for some reasonable minimum value. If a pair of multiplicands may result in a number that exceeds your type's maxium exponent, then test for that as well. If this is the case, then if you are using float types, change to doubles, which may amelioraate the problem in your case.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!