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 » U++ Library support » U++ Core » division by zero check
division by zero check [message #35596] Sat, 03 March 2012 10:22 Go to next message
varu is currently offline  varu
Messages: 21
Registered: March 2012
Location: Bangalore,India
Promising Member
hello

is there any way by which i can check division by zero
in u++

thanks
Re: division by zero check [message #35598 is a reply to message #35596] Sat, 03 March 2012 11:33 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
varu wrote on Sat, 03 March 2012 04:22

hello

is there any way by which i can check division by zero
in u++

thanks


if(divisor == 0) ? Smile

Other than that, no. Division by zero, when it happens, is asynchronous exception that is not handled by C++. You might consider using Win32 exceptions, but IMO it is a bad practice to relly on exception in this case. Division by zero is simply bug in code.

Mirek
Previous Topic: put32 for double precision values..
Next Topic: Color and RGBA
Goto Forum:
  


Current Time: Thu Mar 28 21:09:09 CET 2024

Total time taken to generate the page: 0.00880 seconds