[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

Floating Exception (core dumped)

I am a student and have a relatively straight forward program for calculating sales totals, tax discounts, and another discount.

I compile without any errors but after I enter the tax rate, discount rate and discount qty I get the error:  Floating Exceptin (core dumped).  Is there a simple solution to this that I am unaware of?

Thank you
0
deloused
Asked:
deloused
1 Solution
 
brettmjohnsonCommented:
Floating point exceptions typically occur when you attempt to divide by 0.
Just before you perform a floating point division operation, print out the divisor and dividend - make sure they are the values you expect.   You could also run the program from the debugger.  When the floating point exception occurs, the debugger will halt the program at the point of failure.  You can then examine the contents of variables to make sure they have the expected values.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now