Module: Math
- Defined in:
- lib/source/ruby.rb
Overview
The Math
module contains module functions for basic trigonometric and transcendental functions.
Constant Summary collapse
- E =
2.71828182845904523536
- PI =
3.14159265358979323846
Class Method Summary collapse
-
.acos(x) ⇒ Object
call-seq: Math.acos(x) -> numeric.
-
.acosh(x) ⇒ Object
call-seq: Math.acosh(x) -> numeric.
-
.asin(x) ⇒ Object
call-seq: Math.asin(x) -> numeric.
-
.asinh(x) ⇒ Object
call-seq: Math.asinh(x) -> numeric.
-
.atan(x) ⇒ Object
call-seq: Math.atan(x) -> numeric.
-
.atan2(y, x) ⇒ Object
call-seq: Math.atan2(y,x) -> numeric.
-
.atanh(x) ⇒ Object
call-seq: Math.atanh(x) -> numeric.
-
.cos(x) ⇒ Object
call-seq: Math.cos(x) -> numeric.
-
.cosh(x) ⇒ Object
call-seq: Math.cosh(x) -> numeric.
-
.erf(x) ⇒ Object
call-seq: Math.erf(x) -> numeric.
-
.erfc(x) ⇒ Object
call-seq: Math.erfc(x) -> numeric.
-
.exp(x) ⇒ Object
call-seq: Math.exp(x) -> numeric.
-
.frexp(numeric) ⇒ Object
call-seq: Math.frexp(x) -> [fraction, exponent].
-
.hypot(x, y) ⇒ Object
call-seq: Math.hypot(x,y) -> numeric.
-
.ldexp(flt, int) ⇒ Object
call-seq: Math.ldexp(flt,int) -> numeric.
-
.log(x) ⇒ Object
call-seq: Math.log(x) -> numeric.
-
.log10(x) ⇒ Object
call-seq: Math.log10(x) -> numeric.
-
.sin(x) ⇒ Object
call-seq: Math.sin(x) -> numeric.
-
.sinh(x) ⇒ Object
call-seq: Math.sinh(x) -> numeric.
-
.sqrt(x) ⇒ Object
call-seq: Math.sqrt(x) -> numeric.
-
.tan(x) ⇒ Object
call-seq: Math.tan(x) -> numeric.
-
.tanh(x) ⇒ Object
call-seq: Math.tanh(x) -> numeric.
Class Method Details
.acos(x) ⇒ Object
call-seq:
Math.acos(x) -> numeric
Computes the arc cosine of x and returns its value in the range 0..PI.
1548 1549 1550 |
# File 'lib/source/ruby.rb', line 1548 def self.acos(x) `Math.acos(x)` end |
.acosh(x) ⇒ Object
call-seq:
Math.acosh(x) -> numeric
FIX: Incomplete
1556 1557 |
# File 'lib/source/ruby.rb', line 1556 def self.acosh(x) end |
.asin(x) ⇒ Object
call-seq:
Math.asin(x) -> numeric
Computes the arc sine of x and returns its value in the range -PI/2..PI/2.
1565 1566 1567 |
# File 'lib/source/ruby.rb', line 1565 def self.asin(x) `Math.asin(x)` end |
.asinh(x) ⇒ Object
call-seq:
Math.asinh(x) -> numeric
FIX: Incomplete
1573 1574 |
# File 'lib/source/ruby.rb', line 1573 def self.asinh(x) end |
.atan(x) ⇒ Object
call-seq:
Math.atan(x) -> numeric
Computes the arc tangent of x and returns its value in the range -PI/2..PI/2.
1582 1583 1584 |
# File 'lib/source/ruby.rb', line 1582 def self.atan(x) `Math.atan(x)` end |
.atan2(y, x) ⇒ Object
call-seq:
Math.atan2(y,x) -> numeric
Computes the arc tangent of y/x and returns its value in the range -PI..PI. The signs of x and y determine the quadrant of the result.
1593 1594 1595 |
# File 'lib/source/ruby.rb', line 1593 def self.atan2(y,x) `Math.atan2(y,x)` end |
.atanh(x) ⇒ Object
call-seq:
Math.atanh(x) -> numeric
FIX: Incomplete
1601 1602 |
# File 'lib/source/ruby.rb', line 1601 def self.atanh(x) end |
.cos(x) ⇒ Object
call-seq:
Math.cos(x) -> numeric
Computes the cosine of x (in radians) and returns its value in the range -1..1.
1610 1611 1612 |
# File 'lib/source/ruby.rb', line 1610 def self.cos(x) `Math.cos(x)` end |
.cosh(x) ⇒ Object
call-seq:
Math.cosh(x) -> numeric
FIX: Incomplete
1618 1619 |
# File 'lib/source/ruby.rb', line 1618 def self.cosh(x) end |
.erf(x) ⇒ Object
call-seq:
Math.erf(x) -> numeric
FIX: Incomplete
1625 1626 |
# File 'lib/source/ruby.rb', line 1625 def self.erf(x) end |
.erfc(x) ⇒ Object
call-seq:
Math.erfc(x) -> numeric
FIX: Incomplete
1632 1633 |
# File 'lib/source/ruby.rb', line 1632 def self.erfc(x) end |
.exp(x) ⇒ Object
call-seq:
Math.exp(x) -> numeric
Returns e**(x).
1640 1641 1642 |
# File 'lib/source/ruby.rb', line 1640 def self.exp(x) `Math.exp(x)` end |
.frexp(numeric) ⇒ Object
call-seq:
Math.frexp(x) -> [fraction, exponent]
FIX: Incomplete
1648 1649 |
# File 'lib/source/ruby.rb', line 1648 def self.frexp(numeric) end |
.hypot(x, y) ⇒ Object
call-seq:
Math.hypot(x,y) -> numeric
FIX: Incomplete
1655 1656 |
# File 'lib/source/ruby.rb', line 1655 def self.hypot(x,y) end |
.ldexp(flt, int) ⇒ Object
call-seq:
Math.ldexp(flt,int) -> numeric
FIX: Incomplete
1662 1663 |
# File 'lib/source/ruby.rb', line 1662 def self.ldexp(flt,int) end |
.log(x) ⇒ Object
call-seq:
Math.log(x) -> numeric
Returns the natural logarithm of x.
1670 1671 1672 1673 |
# File 'lib/source/ruby.rb', line 1670 def self.log(x) `if(x==0){return -Infinity;}` `Math.log(x)` end |
.log10(x) ⇒ Object
call-seq:
Math.log10(x) -> numeric
Returns the base 10 logarithm of x.
1680 1681 1682 1683 |
# File 'lib/source/ruby.rb', line 1680 def self.log10(x) `if(x==0){return -Infinity;}` `Math.log(x)/Math.log(10)` end |
.sin(x) ⇒ Object
call-seq:
Math.sin(x) -> numeric
Computes the sine of x (in radians) and returns its value in the range -1..1.
1691 1692 1693 |
# File 'lib/source/ruby.rb', line 1691 def self.sin(x) `Math.sin(x)` end |
.sinh(x) ⇒ Object
call-seq:
Math.sinh(x) -> numeric
FIX: Incomplete
1699 1700 |
# File 'lib/source/ruby.rb', line 1699 def self.sinh(x) end |
.sqrt(x) ⇒ Object
call-seq:
Math.sqrt(x) -> numeric
Returns the non-negative square root of x.
1707 1708 1709 |
# File 'lib/source/ruby.rb', line 1707 def self.sqrt(x) `Math.sqrt(x)` end |