U++ framework
Do not panic. Ask here before giving up.

Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » FP exception vs NaN
Re: Capture division by zero [message #55279 is a reply to message #55278] Tue, 27 October 2020 11:16 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Yet another example, how are you going to fix this:

double SomeFunction(double x)
{
    return ln(x*x*x - 15*x*x + x + 20);
}


Now this function is used throughout your code on 50 places and you have got an exception because the argument is negative.

How are you going to fix it?

This is the main problem I have encounterd with "activate FP exception" approach and I still do not know the correct solution....

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dumb bug. Improper use of Null
Next Topic: strange MinGw return
Goto Forum:
  


Current Time: Thu Sep 03 23:14:45 GMT+2 2026

Total time taken to generate the page: 0.01067 seconds