Forums Register Login

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

+Pie Number of slices to send: Send
Hi to all,
When will we get the value NaN.Please explain me with examples?
+Pie Number of slices to send: Send
Please anyone give your valuable thoughts about above
+Pie Number of slices to send: Send
"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:

+Pie Number of slices to send: Send
Thanks a lot,Mr.Thirugnanam Saravanan
Now i am well understood.
Thanks again.
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 623 times.
Similar Threads
need help
Confusion about Double.NaN
What is Not-a-Number (NaN)?
abs??
query regarding "=="
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 07:08:38.