Sha256: d203b3bbc37015a5b448c984d4e75640a6b7128cefd798de2aa92eb7b409df7a

Contents?: true

Size: 286 Bytes

Versions: 5

Compression:

Stored size: 286 Bytes

Contents

module Danica
  class SquaredRoot < Operator
    variables :variable
    default_value :is_grouped?, true

    def to_f
      Math.sqrt(variable.to_f)
    end

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

    def to_gnu
      "sqrt(#{variable.to_gnu})"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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