📜  如何在java代码示例中返回nan

📅  最后修改于: 2022-03-11 14:52:04.751000             🧑  作者: Mango

代码示例1
public class NaN
{
    public static void main(String[]args)
    {
        System.out.println(0.0 / 0.0);      //zero divided by zero
        System.out.println(Math.sqrt(-1)); //take sqrt of negative number
        System.out.println(10.0 % 0);      //taking mod by zero
    }
}