Sha256: c7d12cee5949ec0c730890667d70ee5ab22cbdd0820425214bd2709d6a0c21c1

Contents?: true

Size: 316 Bytes

Versions: 10

Compression:

Stored size: 316 Bytes

Contents

class Danica::Operator::Inverse < Danica::Operator
  variables :value

  def to_f
    value.to_f ** -1 #Do not worry with nil value as this has been implemented already raising Danica::Exception::NotDefined
  end

  def to_tex
    "(#{value.to_tex})^{-1}"
  end

  def to_gnu
    "(#{value.to_gnu}) ** -1"
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
danica-2.7.4 spec/support/models/operator/inverse.rb
danica-2.7.3 spec/support/models/operator/inverse.rb
danica-2.7.2 spec/support/models/operator/inverse.rb
danica-2.7.1 spec/support/models/operator/inverse.rb
danica-2.6.4 spec/support/models/operator/inverse.rb
danica-2.6.3 spec/support/models/operator/inverse.rb
danica-2.6.2 spec/support/models/operator/inverse.rb
danica-2.6.1 spec/support/models/operator/inverse.rb
danica-2.6.0 spec/support/models/operator/inverse.rb
danica-2.5.1 spec/support/models/operator/inverse.rb