Sha256: a0e3357a0d21b0154e0240127138facd58a1802ba4c0d58a246d514863c94d9a

Contents?: true

Size: 342 Bytes

Versions: 5

Compression:

Stored size: 342 Bytes

Contents

module Danica
  class Power < Operator
    variables :base, :exponent
    default_value :is_grouped?, false

    def to_f
      base.to_f ** exponent.to_f
    end

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
danica-2.2.1 lib/danica/power.rb
danica-2.2.0 lib/danica/power.rb
danica-2.1.1 lib/danica/power.rb
danica-2.1.0 lib/danica/power.rb
danica-2.0.6 lib/danica/power.rb