MAX_VALUE
A constant holding the largest positive finite value of type float, (2-2-23)·2127.
POSITIVE_INFINITY
A constant holding the positive infinity of type float.
感谢
A constant holding the largest positive finite value of type float, (2-2-23)·2127.
POSITIVE_INFINITY
A constant holding the positive infinity of type float.
感谢
解决方案 »
- 急救,右键添加删除树节点的Java代码 在线等
- 谁能给个记事本的JAVA程序研究下。谢谢啦
- 请教一下equals()方法和“==”的差别
- 字符串标准答案与所填答案的比较
- java压缩文件可以设置解压密码吗?
- [求助]:关于线程的问题??
- SUN ONE Studio 4 CE和Forte For Java CE安装时需要IDE?
- 存储过程执行错误: 对只转发结果集的无效操作?解决后定送100分。
- 急!!请问如何将输入的INT或LONG型的数据按位(十进制)数输出,日期型按照如1988年12月12日 3点50分输出???
- jetcar一类下载工具的断点续传功能怎么做?
- ???求一个正则表达式。。。。
- 请大家介绍一本比较好的关于计算机网络基础的书吧!
System.out.println(Double.MAX_VALUE/2);
System.out.println(Double.POSITIVE_INFINITY); //这是一个无限的值
System.out.println(Double.POSITIVE_INFINITY/2);Result:1.7976931348623157E308
8.988465674311579E307
Infinity
Infinity
System.out.println(Double.MAX_VALUE);
/**
* A constant holding the positive infinity of type
* <code>double</code>. It is equal to the value returned by
* <code>Double.longBitsToDouble(0x7ff0000000000000L)</code>.
*/
public static final double POSITIVE_INFINITY = 1.0 / 0.0;........................................................................
double i = 1;
double j = 0;
try {
if (i / j == Double.POSITIVE_INFINITY)
;
{
System.out.println("Infinity");
}
} catch (Exception e) {
e.printStackTrace(); } }
/**
* A constant holding the positive infinity of type
* <code>double</code>. It is equal to the value returned by
* <code>Double.longBitsToDouble(0x7ff0000000000000L)</code>.
*/
public static final double POSITIVE_INFINITY = 1.0 / 0.0;
public class abc { /**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
double i = 4;
double j = 2;
try {
if (i / j == Double.NEGATIVE_INFINITY)
;
{
System.out.println("Infinity");
}
} catch (Exception e) {
e.printStackTrace(); } }}
这样为什么是相等,,,晕,又一次请教,呵呵,
double j = 2;
try {
if (i / j == Double.NEGATIVE_INFINITY)
;。
{
System.out.println("Infinity");
}
} catch (Exception e) {
e.printStackTrace(); }你打错了,多打个了分号,程序逻辑错了,去掉就不等了