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 #55298 is a reply to message #55296] Tue, 27 October 2020 19:25 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3360
Registered: August 2008
Senior Veteran
mirek wrote on Tue, 27 October 2020 19:19
koldo wrote on Tue, 27 October 2020 17:18
Quote:
Yeah, so your program now does not work in debug for particular input data. What is the next step?


The next step when TheIDE debugger breaks is to solve the problem Smile


Or if you want more practical example, take

examples/FnGraph

then activate fp exceptions, start the debugger and enter ln(x). Then tell me how you fixed the code....

Then try to imagine all the fixes you will need to make to avoid all FP exceptions and I can guarantee you two things:

a) you have probably missed something
b) the code will be about 2 times longer and much harder to maintain

Mirek


Sorry Mirek

What you say is not conceivable for me. In my world a negative square root is the same as a Vector v(2); v[-1] = 2;
The only explanation is that we work in very different computing environments.


Best regards
IƱaki
 
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 13:04:39 CEST 2024

Total time taken to generate the page: 0.02389 seconds