Class: Float

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

Overview

When mathn is required, Float is changed to handle Complex numbers.

Instance Method Summary collapse

Instance Method Details

#**(other) ⇒ Object

Exponentiate by other



316
317
318
319
320
321
322
# File 'lib/mathn.rb', line 316

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

#power!Object



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

alias power! **