
java.lang.StrictMath是一个最终类,它是Object类的子类。 StrictMath 类包含用于执行基本数字运算的方法,例如初等指数、对数、平方根和三角函数。我们不需要为StrictMath类创建实例,因为StrictMath类中的所有方法都是静态方法。 StrictMath类的重要方法有abs()、acos()、asin()、atan()、ceil()、floor()、log()、max()、min()、pow()、 random()、round() 等
LWP是Library for Web access in Perl的缩写,用途说得很清楚,就是一个访问Web服务器的Perl包。 利用LWP这个包,我们可以很方便的在我们的perl脚本里面访问外部的Web服务器上面的资源。 为什么要用LWP? 现在的网站应用越做越复杂,要想简单的写一个Sockettelnet去用GET指令获取资源简直是不可能的,特别是一些需要用口令登陆的网站。 如果你只想简单获取一些资源而不想写太多比较复杂的代码的话,那么就应该选用一个合适的封装起来的HTTPD模块。 这些文件的确国内
0
public final class StrictMath extends Object
public class StrictMathTest {
public static void main(String args[]) {
System.out.println("Absolute Value: " + StrictMath.abs(-100.50));
System.out.println("Ceil Value : " + StrictMath.ceil(100.55));
System.out.println("Floor Value : " + StrictMath.floor(100.55));
System.out.println("Maximum Value : " + StrictMath.max(100,200));
System.out.println("Minimum Value : " + StrictMath.min(100,200));
System.out.println("Random Value : " + StrictMath.random());
System.out.println("Round Value: " + StrictMath.round(100.75));
System.out.println("Square Root Value : " + StrictMath.sqrt(2));
System.out.println("PI Value: " + StrictMath.PI);
System.out.println("Log Value: " + StrictMath.log(10.55));
}
}Absolute Value: 100.5 Ceil Value : 101.0 Floor Value : 100.0 Maximum Value : 200 Minimum Value : 100 Random Value : 0.22227639516105102 Round Value: 101 Square Root Value : 1.4142135623730951 PI Value: 3.141592653589793 Log Value: 2.3561258599220753
以上就是StrictMath类在Java中的用途是什么?的详细内容,更多请关注php中文网其它相关文章!
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号