Sha256: ceabb78de3391e5f1c8325cf3de3617cf4490ef6a3dc59e622f1cdbad9af34ad

Contents?: true

Size: 326 Bytes

Versions: 2

Compression:

Stored size: 326 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

2 entries across 2 versions & 1 rubygems

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