首页 > 学院 > 开发设计 > 正文

Float isNaN() 样例

2019-11-08 19:31:18
字体:
来源:转载
供稿:网友

/* * boolean isNaN(float f) static method checks whether the agrument * PRimitive float value is Not-a-Number value or not. It return true if * the specified argument is Not-a-Number value, false otherwise. */ float f = (float) Math.sqrt(-10); System.out.println(f); boolean b1 = Float.isNaN(f); System.out.println(b1);

/* * boolean isNaN() instance method checks whether the Float object is * Not-a-Number value or not. It return true if the object is * Not-a-Number value, false otherwise. */ Float fObj = new Float(f); boolean b2 = fObj.isNaN(); System.out.println(b2);
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表