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

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.



1530
1531
1532
# File 'lib/source/ruby.rb', line 1530

def self.acos(x)
  `Math.acos(x)`
end

.acosh(x) ⇒ Object

call-seq:

Math.acosh(x) -> numeric

FIX: Incomplete



1538
1539
# File 'lib/source/ruby.rb', line 1538

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.



1547
1548
1549
# File 'lib/source/ruby.rb', line 1547

def self.asin(x)
  `Math.asin(x)`
end

.asinh(x) ⇒ Object

call-seq:

Math.asinh(x) -> numeric

FIX: Incomplete



1555
1556
# File 'lib/source/ruby.rb', line 1555

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.



1564
1565
1566
# File 'lib/source/ruby.rb', line 1564

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.



1575
1576
1577
# File 'lib/source/ruby.rb', line 1575

def self.atan2(y,x)
  `Math.atan2(y,x)`
end

.atanh(x) ⇒ Object

call-seq:

Math.atanh(x) -> numeric

FIX: Incomplete



1583
1584
# File 'lib/source/ruby.rb', line 1583

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.



1592
1593
1594
# File 'lib/source/ruby.rb', line 1592

def self.cos(x)
  `Math.cos(x)`
end

.cosh(x) ⇒ Object

call-seq:

Math.cosh(x) -> numeric

FIX: Incomplete



1600
1601
# File 'lib/source/ruby.rb', line 1600

def self.cosh(x)
end

.erf(x) ⇒ Object

call-seq:

Math.erf(x) -> numeric

FIX: Incomplete



1607
1608
# File 'lib/source/ruby.rb', line 1607

def self.erf(x)
end

.erfc(x) ⇒ Object

call-seq:

Math.erfc(x) -> numeric

FIX: Incomplete



1614
1615
# File 'lib/source/ruby.rb', line 1614

def self.erfc(x)
end

.exp(x) ⇒ Object

call-seq:

Math.exp(x) -> numeric

Returns e**(x).



1622
1623
1624
# File 'lib/source/ruby.rb', line 1622

def self.exp(x)
  `Math.exp(x)`
end

.frexp(numeric) ⇒ Object

call-seq:

Math.frexp(x) -> [fraction, exponent]

FIX: Incomplete



1630
1631
# File 'lib/source/ruby.rb', line 1630

def self.frexp(numeric)
end

.hypot(x, y) ⇒ Object

call-seq:

Math.hypot(x,y) -> numeric

FIX: Incomplete



1637
1638
# File 'lib/source/ruby.rb', line 1637

def self.hypot(x,y)
end

.ldexp(flt, int) ⇒ Object

call-seq:

Math.ldexp(flt,int) -> numeric

FIX: Incomplete



1644
1645
# File 'lib/source/ruby.rb', line 1644

def self.ldexp(flt,int)
end

.log(x) ⇒ Object

call-seq:

Math.log(x) -> numeric

Returns the natural logarithm of x.



1652
1653
1654
1655
# File 'lib/source/ruby.rb', line 1652

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.



1662
1663
1664
1665
# File 'lib/source/ruby.rb', line 1662

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.



1673
1674
1675
# File 'lib/source/ruby.rb', line 1673

def self.sin(x)
  `Math.sin(x)`
end

.sinh(x) ⇒ Object

call-seq:

Math.sinh(x) -> numeric

FIX: Incomplete



1681
1682
# File 'lib/source/ruby.rb', line 1681

def self.sinh(x)
end

.sqrt(x) ⇒ Object

call-seq:

Math.sqrt(x) -> numeric

Returns the non-negative square root of x.



1689
1690
1691
# File 'lib/source/ruby.rb', line 1689

def self.sqrt(x)
  `Math.sqrt(x)`
end

.tan(x) ⇒ Object

call-seq:

Math.tan(x) -> numeric

Computes the tangent of x (in radians) and returns its value.



1698
1699
1700
# File 'lib/source/ruby.rb', line 1698

def self.tan(x)
  `Math.tan(x)`
end

.tanh(x) ⇒ Object

call-seq:

Math.tanh(x) -> numeric

FIX: Incomplete



1706
1707
# File 'lib/source/ruby.rb', line 1706

def self.tanh(x)
end