File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes When will we get the value [B]NaN[/B]. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "When will we get the value [B]NaN[/B]." Watch "When will we get the value [B]NaN[/B]." New topic
Author

When will we get the value [B]NaN[/B].

pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
Hi to all,
When will we get the value NaN.Please explain me with examples?


SCJP 5.0(75%), SCWCD 5.0(88%)
pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
Please anyone give your valuable thoughts about above
Thirugnanam Saravanan
Ranch Hand

Joined: Dec 13, 2007
Posts: 81
"NaN" stands for "Not a Number". "NaN" is produced if a floating point operation has some input parameters that cause the operation to produce some undefined result. For example, 0.0 divided by 0.0 is arithmetically undefined. Taking the square root of a negative number is also undefined.

0.0 / 0.0 -> NaN
Math.sqrt(-2.0) -> NaN


Refer The following example:



Saravanan
SCJP 5.0(98%), SCWCD 5.0 (100%), OCA
pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
Thanks a lot,Mr.Thirugnanam Saravanan
Now i am well understood.
Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When will we get the value [B]NaN[/B].