Sha256: 9392ee43cd71bf600f416b3f35eb87f50947b97b05aa0f10f3ae55f2d586498b

Contents?: true

Size: 332 Bytes

Versions: 3

Compression:

Stored size: 332 Bytes

Contents

module Danica
  class Division < Operator
    variables :numerator, :denominator

    def to_f
      numerator.to_f / denominator.to_f
    end

    private

    def tex_string
      "\\frac{#{numerator.to_tex}}{#{denominator.to_tex}}"
    end

    def gnu_string
      "#{numerator.to_gnu}/#{denominator.to_gnu}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danica-2.0.4 lib/danica/division.rb
danica-2.0.3 lib/danica/division.rb
danica-2.0.2 lib/danica/division.rb