JAVA常用数学类方法
2010-03-12 13:49
411 查看
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"/@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
在java中有一些常用的数学方法,如下:
Math.abs(-12);//
求绝对值
Math.max(10, 19);//
求两个数中的最大数
Math.min(10, 19);//
求两个数中的最小数
Math.pow(3, 4);//
求次方
Math.floor(4.32);//
比参数值小的最大整数
(
返回
double)
Math.ceil(4.32);//
比参数值小的最大整数
(
返回
double)
(int)(54 * Math.random());//0-53
之间的随机整数
//
0.0<=x<1->0.0<=54x<54->int
如大家觉得不完全,可以补充,谢谢。。。
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"/@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.5pt;
mso-bidi-font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;
mso-font-kerning:1.0pt;}
/* Page Definitions */
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:36.0pt;
mso-footer-margin:36.0pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
在java中有一些常用的数学方法,如下:
Math.abs(-12);//
求绝对值
Math.max(10, 19);//
求两个数中的最大数
Math.min(10, 19);//
求两个数中的最小数
Math.pow(3, 4);//
求次方
Math.floor(4.32);//
比参数值小的最大整数
(
返回
double)
Math.ceil(4.32);//
比参数值小的最大整数
(
返回
double)
(int)(54 * Math.random());//0-53
之间的随机整数
//
0.0<=x<1->0.0<=54x<54->int
如大家觉得不完全,可以补充,谢谢。。。
相关文章推荐
- Java的常用方法--输入输出流
- JAVA 之 Date常用方法
- Java初学_ArrayList常用方法
- java开发中linux常用方法
- Java面向对象基础--String类中常用的方法
- java File常用方法
- JAVA MATH类常用方法
- java中String的常用方法
- Java中常用加密/解密方法详解
- 24 java 常用的方法
- 关于数学公式输入中括号的换行问题 的两种常用方法
- Java——线程间通信 常用方法
- Java多线程(一些常用方法)
- java多线程-常用方法
- java中的StringBuilder类常用方法
- Java常用类及其常用方法
- Java调用SQL脚本执行常用的方法示例
- Java中的线程(二)-线程相关的常用方法介绍
- Java更新XML的四种常用方法简介
- Java String的常用方法及使用注意事项