Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 13975
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: Tue May 07 14:19:02 CEST 2024

Total time taken to generate the page: 0.04806 seconds