Class: Danica::Operator::Power

Inherits:
Danica::Operator show all
Defined in:
lib/danica/operator/power.rb

Instance Method Summary collapse

Methods inherited from Danica::Operator

#==

Methods included from BaseOperations

#*, #**, #+, #-, #-@, #/

Methods included from VariablesHolder

#calculate, #initialize, #variables=

Methods included from Common

#content, #formatted, #gnu, #tex, #to, #valued?

Instance Method Details

#to_fObject



8
9
10
# File 'lib/danica/operator/power.rb', line 8

def to_f
  base.to_f**exponent.to_f
end

#to_gnu(**options) ⇒ Object



16
17
18
# File 'lib/danica/operator/power.rb', line 16

def to_gnu(**options)
  "#{wrap_as_group(base).to_gnu(options)}**(#{exponent.to_gnu(options)})"
end

#to_tex(**options) ⇒ Object



12
13
14
# File 'lib/danica/operator/power.rb', line 12

def to_tex(**options)
  "#{wrap_as_group(base).to_tex(options)}^{#{exponent.to_tex(options)}}"
end