Sha256: 9df0bf9bff8d729de8a30ebcabbfcfb6131b16c35c42ec4a436d27214ae949e6

Contents?: true

Size: 333 Bytes

Versions: 11

Compression:

Stored size: 333 Bytes

Contents

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

11 entries across 11 versions & 1 rubygems

Version Path
danica-2.7.4 spec/support/models/expression/baskara.rb
danica-2.7.3 spec/support/models/expression/baskara.rb
danica-2.7.2 spec/support/models/expression/baskara.rb
danica-2.7.1 spec/support/models/expression/baskara.rb
danica-2.6.4 spec/support/models/expression/baskara.rb
danica-2.6.3 spec/support/models/expression/baskara.rb
danica-2.6.2 spec/support/models/expression/baskara.rb
danica-2.6.1 spec/support/models/expression/baskara.rb
danica-2.6.0 spec/support/models/expression/baskara.rb
danica-2.5.1 spec/support/models/expression/baskara.rb
danica-2.5.0 spec/support/models/expression/baskara.rb