Sha256: 63c281fc328497678e19c2282d80fe75890ecf164ac70371e88e7ab24d942e51

Contents?: true

Size: 318 Bytes

Versions: 2

Compression:

Stored size: 318 Bytes

Contents

module Danica
  class Function
    class SquareRoot < Function
      variables :variable

      def to_f
        Math.sqrt(variable.to_f)
      end

      private

      def tex_string
        "\\sqrt{#{variable.to_tex}}"
      end

      def gnu_string
        "sqrt(#{variable.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/square_root.rb
danica-1.1.0 lib/danica/function/square_root.rb