| abs() | ใช้หาค่าสัมบูรณ์ |
|---|---|
| sqrt() | ใช้หาค่ารากที่สอง |
| pow() | ใช้หาค่ายกกำลัง |
| ceil() | ใช้ปัดเศษทศนิยมให้มีค่ามากขึ้น |
| floor() | ใช้ปัดเศษทศนิยมให้มีค่าน้อยลง |
| round() | ใช้ปัดเศษทศนิยมตามปกติ ( คือ มากกว่าหรือเท่ากับ 5 จะปัดขึ้น และ น้อยกว่า 5 จะปัดลง ) |
| random() | ใช้ในการสุ่มตัวเลข ระหว่าง 0 ถึง 1 |
| max() | ใช้ในการหาค่าที่มากกว่าระหว่างตัวเลขที่กำหนด |
| min() | ใช้ในการหาค่าที่น้อยกว่าระหว่างตัวเลขที่กำหนด |
| log() | ใช้หาค่า log |
| exp() | ใช้หาค่า e ยกกำลัง ( e มีค่าประมาณ 2.71828 ) |
| sin() | ใช้หาค่า sine ของมุมที่กำหนด |
| cos() | ใช้หาค่า cosine ของมุมที่กำหนด |
| tan() | ใช้หาค่า tan ของมุมที่กำหนด |
| asin() | ใช้หาค่า arc sine ของตัวเลขที่กำหนด |
| acos() | ใช้หาค่า arc cosine ของตัวเลขที่กำหนด |
| atan() | ใช้หาค่า arc tangent ของตัวเลขที่กำหนด |
| atan2() | ใช้หาค่ามุมพิกัดโพลาร์ ของพิกัด x และ y |
| PI | ใช้คืนค่า PI ซึ่งเท่ากับ 3.141592653589793 |
method:abs ( int );
return type:int
special:static
content:ใช้หาค่าสัมบูรณ์
example:int number = abs ( -8 );
method:sqrt ( int );
return type:int
special:static
content:ใช้หาค่ารากที่สอง
example:int number = sqrt ( 4 );
method:pow ( base, exp );
return type:int
special:static
content:ใช้หาค่ายกกำลัง
example:int number = pow ( 2, 4 );
method:ceil ( int );
return type:int
special:static
content:ใช้ปัดเศษทศนิยมให้มีค่ามากขึ้น
example:int number = ceil ( 2.3 );
method:floor ( int );
return type:int
special:static
content:ใช้ปัดเศษทศนิยมให้มีค่าน้อยลง
example:int number = floor ( -2.8 );
method:round ( int );
return type:int
special:static
content:ใช้ปัดเศษทศนิยมตามปกติ ( คือ มากกว่าหรือเท่ากับ 5 จะปัดขึ้น และ น้อยกว่า 5 จะปัดลง )
example:int number = round ( -2.8 );
method:random ();
return type:double
special:static
content:ใช้ในการสุ่มตัวเลข ระหว่าง 0 ถึง 1
example:double rannumber = random();
method:max ( int_1, int_ 2 );
return type:int
special:static
content:ใช้ในการหาค่าที่มากกว่าระหว่างตัวเลขที่กำหนด
example:int number = max ( 2, 5 );
method:min ( int_1, int_ 2 );
return type:int
special:static
content:ใช้ในการหาค่าที่น้อยกว่าระหว่างตัวเลขที่กำหนด
example:int number = min ( 2, 5 );
method:log ( int );
return type:double
special:static
content:ใช้หาค่า log
example:double number = log ( 10 );
method:exp ( int );
return type:double
special:static
content:ใช้หาค่า e ยกกำลัง ( e มีค่าประมาณ 2.71828 )
example:double number = exp( 10 );
method:sin ( int );
return type:double
special:static
content:ใช้หาค่า sine ของมุมที่กำหนด
example:double num = Math.sin ( 45 );
method:cos ( int );
return type:double
special:static
content:ใช้หาค่า cosine ของมุมที่กำหนด
example:double num = Math.cos ( 30 );
method:tan ( int );
return type:double
special:static
content:ใช้หาค่า tan ของมุมที่กำหนด
example:double num = Math.tan ( 90 );
method:asin ( int );
return type:double
special:static
content:ใช้หาค่า arc sine ของตัวเลขที่กำหนด
example:double num = Math.asin ( 3.45 );
method:acos ( int );
return type:double
special:static
content:ใช้หาค่า arc cosine ของตัวเลขที่กำหนด
example:double num = Math.acos ( 0.25 );
method:atan ( int );
return type:double
special:static
content:ใช้หาค่า arc tangent ของตัวเลขที่กำหนด
example:double num = Math.atan ( 0.75 );
method:atan2 ( x, y );
return type:double
special:static
content:ใช้หาค่ามุมพิกัดโพลาร์ ของพิกัด x และ y
example:double num = Math.atan2 ( 3, 4 );
property:PI;
return type:double
special:static
content:ใช้คืนค่า PI ซึ่งเท่ากับ 3.141592653589793
example:double num = Math.PI;