Class: Bignum

Inherits:
Object
  • Object
show all
Defined in:
lib/mathn.rb

Overview

When mathn is required Bignum’s division and exponentiation are enhanced to return more precise values from mathematical expressions.

Instance Method Summary collapse

Instance Method Details

#**(other) ⇒ Object

Exponentiate by other



107
108
109
110
111
112
113
# File 'lib/mathn.rb', line 107

def ** (other)
  if self < 0 && other.round != other
    Complex(self, 0.0) ** other
  else
    power!(other)
  end
end

#power!Object



102
# File 'lib/mathn.rb', line 102

alias power! **