Class: Numeric

Inherits:
Object show all
Defined in:
lib/y_support/unicode.rb

Overview

Defined aliases

  • – root of arbitrary degree ( x.√( n ) is n ** ( 1 / x ) ).

  • sqrt as in 4.sqrt for square root (Math#sqrt).

Instance Method Summary collapse

Instance Method Details

#sqrtObject

Square root (using Math#sqrt).



67
68
69
# File 'lib/y_support/unicode.rb', line 67

def sqrt
  Math.sqrt( self )
end

#(number) ⇒ Object

Returns n-th root of the argument, where n is the receiver number.



61
62
63
# File 'lib/y_support/unicode.rb', line 61

def  number
  number ** ( 1.0 / self )
end