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 #55305 is a reply to message #55299] Wed, 28 October 2020 09:29 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3360
Registered: August 2008
Senior Veteran
Klugier wrote on Tue, 27 October 2020 20:35
Hello,

I slowly stop understanding what this thread is about? I think it is perfectly fine to validate input each time it can be wrong - this is the secure coding principles. So, in example bring by kold when i (-1) "v(2); v[i] = 2;", we should always check and handling appropriate. The same is true for divided by zero problem.

The only problem I have is that the CrashHandler is forced by using SysInfo package on Debug mode. For me the class should not be there in nay cases. If you would like to write such debug code just do it in your application not in the library. This is my postulate. If this code will help you find errors in your application that's fine, but use it only there.

EDIT: I saw that crash handler was removed from SysInfo. Thanks!

Klugier


CrashHandler capture of FP errors was activated only in DEBUG mode, like U++ Vector bounds calculation: no overhead added to RELEASE.
U++ Vector bounds check is forced by default in DEBUG. It seemed fair to do the same with other errors.


Best regards
IƱaki

[Updated on: Wed, 28 October 2020 09:30]

Report message to a moderator

 
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 08:26:06 CEST 2024

Total time taken to generate the page: 0.02662 seconds