Sha256: caa098831f5dbfe7b43e2d88e45981da2d337293248d4c128ba07c99f6f13de5

Contents?: true

Size: 426 Bytes

Versions: 1

Compression:

Stored size: 426 Bytes

Contents

module Danica
  class Function::Baskara < Function
    variables :a, :b, :c
    delegate :to_f, :to_tex, :to_gnu, to: :division

    private

    def division
      numerator / denominator
    end

    def numerator
       Negative.new(b) + PositiveNegative.new(SquaredRoot.new(delta))
    end

    def denominator
      Number.new(2) * a
    end

    def delta
      Power.new(b, 2) - Product.new(4, a, c)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
danica-2.1.0 spec/support/models/functions/baskara.rb