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.



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

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

.acosh(x) ⇒ Object

call-seq:

Math.acosh(x) -> numeric

FIX: Incomplete



1544
1545
# File 'lib/source/ruby.rb', line 1544

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.



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

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

.asinh(x) ⇒ Object

call-seq:

Math.asinh(x) -> numeric

FIX: Incomplete



1561
1562
# File 'lib/source/ruby.rb', line 1561

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.



1570
1571
1572
# File 'lib/source/ruby.rb', line 1570

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.



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

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

.atanh(x) ⇒ Object

call-seq:

Math.atanh(x) -> numeric

FIX: Incomplete



1589
1590
# File 'lib/source/ruby.rb', line 1589

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.



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

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

.cosh(x) ⇒ Object

call-seq:

Math.cosh(x) -> numeric

FIX: Incomplete



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

def self.cosh(x)
end

.erf(x) ⇒ Object

call-seq:

Math.erf(x) -> numeric

FIX: Incomplete



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

def self.erf(x)
end

.erfc(x) ⇒ Object

call-seq:

Math.erfc(x) -> numeric

FIX: Incomplete



1620
1621
# File 'lib/source/ruby.rb', line 1620

def self.erfc(x)
end

.exp(x) ⇒ Object

call-seq:

Math.exp(x) -> numeric

Returns e**(x).



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

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

.frexp(numeric) ⇒ Object

call-seq:

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

FIX: Incomplete



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

def self.frexp(numeric)
end

.hypot(x, y) ⇒ Object

call-seq:

Math.hypot(x,y) -> numeric

FIX: Incomplete



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

def self.hypot(x,y)
end

.ldexp(flt, int) ⇒ Object

call-seq:

Math.ldexp(flt,int) -> numeric

FIX: Incomplete



1650
1651
# File 'lib/source/ruby.rb', line 1650

def self.ldexp(flt,int)
end

.log(x) ⇒ Object

call-seq:

Math.log(x) -> numeric

Returns the natural logarithm of x.



1658
1659
1660
1661
# File 'lib/source/ruby.rb', line 1658

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.



1668
1669
1670
1671
# File 'lib/source/ruby.rb', line 1668

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.



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

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

.sinh(x) ⇒ Object

call-seq:

Math.sinh(x) -> numeric

FIX: Incomplete



1687
1688
# File 'lib/source/ruby.rb', line 1687

def self.sinh(x)
end

.sqrt(x) ⇒ Object

call-seq:

Math.sqrt(x) -> numeric

Returns the non-negative square root of x.



1695
1696
1697
# File 'lib/source/ruby.rb', line 1695

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.



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

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

.tanh(x) ⇒ Object

call-seq:

Math.tanh(x) -> numeric

FIX: Incomplete



1712
1713
# File 'lib/source/ruby.rb', line 1712

def self.tanh(x)
end