Sha256: bc802d058d3956121f71488f905038a980409fb02abcdf7b5c41c4462de1f8df

Contents?: true

Size: 263 Bytes

Versions: 2

Compression:

Stored size: 263 Bytes

Contents

module Danica
  class SquareRoot < Operator
    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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
danica-2.0.1 lib/danica/square_root.rb
danica-2.0.0 lib/danica/square_root.rb