Int, long, float, double range (Java)
•
Java
Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("--------JDK1.8中数字范围测试----"); Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("int 最小值的常量:"+iMin); //左边界大概范围:-Math.pow(10,9); 21474 83647 Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("int 最大值的常量:"+iMax); //右边界大概范围:+Math.pow(10,9); Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("long 最小值的常量:"+lMin);//左边界大概范围:-Math.pow(10,17) 9223 37203 68547 75808 Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("long 最大值的常量:"+lMax);//右边界大概范围:+Math.pow(10,17) Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("float 最小正非零值的常数:"+fMin);//左边界大概范围:-Math.pow(10,38) Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("float 最大正非零值的常数:"+fMax);//右边界大概范围:+Math.pow(10,38) Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("double 最小正非零值的常数:"+dMin);//左边界大概范围:-Math.pow(10,308) Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("double 最大正非零值的常数:"+dMax);//右边界大概范围:+Math.pow(10,308) //test Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("------------------------------"); float negF=-3.4028235E38F; Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("最小float值:"+negF); double negD=-1.7976931348623157E308D; Sy<a href="https://www.jb51.cc/tag/stem/" target="_blank" class="keywords">stem</a>.out.println("最小double值:"+negD); }
}
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码