Sha256: c3d55ea0b0a69faa72695dbc25d981cdfe7b90e7e153998de449e42cf02e0a1f

Contents?: true

Size: 341 Bytes

Versions: 2

Compression:

Stored size: 341 Bytes

Contents

module Danica
  class Function
    class Power < Function
      variables :base, :exponent

      def to_f
        base.to_f ** exponent.to_f
      end

      private

      def tex_string
        "#{base.to_tex}^{#{exponent.to_tex}}"
      end

      def gnu_string
        "#{base.to_gnu}**#{exponent.to_gnu}"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
danica-1.2.0 lib/danica/function/power.rb
danica-1.1.0 lib/danica/function/power.rb