Sha256: 395f54cd5f8e0fac4de5a61c13f8bff995493c0256014d8e09505e1b7f3a6d51

Contents?: true

Size: 361 Bytes

Versions: 3

Compression:

Stored size: 361 Bytes

Contents

# frozen_string_literal: true

module Danica
  class Expression::Baskara < Expression.build(:a, :b, :c) { numerator / denominator }
    private

    def numerator
      negative(b) + Wrapper::PlusMinus.new(squared_root(delta))
    end

    def denominator
      number(2) * a
    end

    def delta
      power(b, 2) - multiplication(4, a, c)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
danica-2.7.7 spec/support/models/expression/baskara.rb
danica-2.7.6 spec/support/models/expression/baskara.rb
danica-2.7.5 spec/support/models/expression/baskara.rb