Floating Exception (core dumped)

Posted on 2006-04-18
Last Modified: 2012-06-22
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
Question by:deloused
    1 Comment
    LVL 23

    Accepted Solution

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
    Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
    The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
    The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now