+ 7

Please give some examples when we can encounter NaN in java

e. g. 0/0

6th May 2017, 8:37 AM
Vaibhav Sharma
Vaibhav Sharma - avatar
5 Answers
+ 22
Math.log(-5)
6th May 2017, 8:53 AM
Dev
Dev - avatar
+ 21
Math.sqrt(-5)
6th May 2017, 8:50 AM
Dev
Dev - avatar
+ 18
4/0 NaN stands for Not a Number //
6th May 2017, 8:42 AM
Dev
Dev - avatar
+ 7
Thanks anubhav but cpp and java may have different rules for NaN
6th May 2017, 9:31 AM
Vaibhav Sharma
Vaibhav Sharma - avatar
+ 6
@Dayve Actually i know nan means not a number and i also know one example division by zero but can you please provide some more examples
6th May 2017, 8:44 AM
Vaibhav Sharma
Vaibhav Sharma - avatar