wood burning stoves 2.0*
The moose likes Mock Exam Errata and the fly likes Rules roundup #113 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "Rules roundup #113" Watch "Rules roundup #113" New topic
Author

Rules roundup #113

Arnold Reuser
Ranch Hand

Joined: Nov 20, 2003
Posts: 194
Question : What happens when you have this in you code
double x; x = 24.0/0;
Answer : Compiles and runs.
Floating point numbers don�t produce a divide-by-zero ArithmeticException. They will give a result which is a Not a Number value.
Maybe the answer should be : Compiles and runs.
Floating point numbers don�t produce a divide-by-zero ArithmeticException. They will give a result which is Double.POSITIVE_INFINITY.
Also notice that 24.0%0 gives NaN.
Rajith Vidanaarachchi
Greenhorn

Joined: Nov 06, 2004
Posts: 11
Hello,
I previously thought that the answer was correct but now I typed it and Compiled it and got the output.You are correct!


[ December 21, 2004: Message edited by: Rajith Vidanaarachchi ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Rules roundup #113