In Files



Class Index [+]



Base module for Math modules for specific Num classes. Math modules area analogous to ::Math and provide both a means to access math functions (of the current context for a Num class) and, more useful here, a means to access the functions unqualified by including the module in some scope.

The math functions provided by Math modules are trigonometric (sin, cos, tan, asin, acos, atan, hypot), exp, log, log2, and log10.


  DecNum.context(:precision=>5) do
    puts DecNum::Math.sqrt(2)        # => 1.4142
  DecNum.context.precision = 10
  include DecNum::Math
  puts sqrt(2)                       # => 1.414213562

Public Class Methods

included(base) click to toggle source
    # File lib/flt/math.rb, line 25
25:     def self.included(base)
26:       base.extend ClassMethods
27:     end

Disabled; run with --debug to generate this.


Generated with the Darkfish Rdoc Generator 1.1.6.