Sha256: aa5b6444b84e65fb75d528e5e25582bca56efded3babc3a0b3383833abfda35a

Contents?: true

Size: 1015 Bytes

Versions: 1

Compression:

Stored size: 1015 Bytes

Contents

= NumericMath

== Overview

NumericMath extends the Numeric class with methods from Math
module. The purpose is to increase productivity when using Math module
methods interactively. Some might find the simpler approach convenient
also for actual programs.

For example, without NumericMath you take "sin" of 1.5 as:

  Math.sin( 1.5 )

With NumericMath you do:

  1.5.sin

Math module includes many single argument methods, which take the from
as above. Two argument methods are mapped, so that first argument is
"self" and the second argument becomes the first and only parameter
for the new form.

For example, what is originally:

  Math.log( 4, 2 )

is with NumericMath:

  4.log( 2 )


The mapped methods are also usable as class methods, e.g:

  Fixnum.sin( 2 )


== Mapped methods

List of single argument methods: cos, sin, tan, acos, asin, atan,
cosh, sinh, tanh, acosh, asinh, atanh, exp, log2, log10, sqrt, cbrt,
frexp, erf, erfc, gamma, lgamma.

List of two argument methods: atan2, log, hypot, ldexp.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
numeric_math-0.0.1 README.rdoc