Sha256: d4fd4278f343174fef2d73a743ffb666f2b5a19998c825f48086704dae5384e4

Contents?: true

Size: 346 Bytes

Versions: 3

Compression:

Stored size: 346 Bytes

Contents

# frozen_string_literal: true

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

3 entries across 3 versions & 1 rubygems

Version Path
danica-2.7.7 spec/support/models/operator/inverse.rb
danica-2.7.6 spec/support/models/operator/inverse.rb
danica-2.7.5 spec/support/models/operator/inverse.rb