Sha256: e98244e93c0acc57cee1959f9a69e725516a9651678c9fe00ad4c35a71213963

Contents?: true

Size: 543 Bytes

Versions: 1

Compression:

Stored size: 543 Bytes

Contents

module Danica
  class Function
    class Division < Function
      attr_reader :numerator, :denominator

      def to_f
        numerator.to_f / denominator.to_f
      end

      def numerator=(value)
        @numerator = wrap_value(value)
      end

      def denominator=(value)
        @denominator = wrap_value(value)
      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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danica-1.0.0 lib/danica/function/division.rb