Sha256: a632c622cf40c4f447ecd2330ebf616dbef41c2c3afc4afc0916c6d3e4270c88

Contents?: true

Size: 453 Bytes

Versions: 5

Compression:

Stored size: 453 Bytes

Contents

require 'spec_helper'

describe Dydx::Algebra::Operator::Parts::Inverse do
  it { expect(inverse(x, :+).to_s).to eq('( - x )') }
  it { expect(inverse(x, :*).to_s).to eq('( 1 / x )') }

  it { expect(inverse(x, :+)).to eq(inverse(x, :+)) }
  it { expect(inverse(x, :*)).to eq(inverse(x, :*)) }

  it { expect(x - x).to eq(0) }
  it { expect(x / x).to eq(1) }
  it { expect(inverse(x, :+) + x).to eq(0) }
  it { expect(inverse(x, :*) * x).to eq(1) }
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dydx-0.2.7000001 spec/lib/algebra/operator/parts/inverse_spec.rb
dydx-0.2.7000000 spec/lib/algebra/operator/parts/inverse_spec.rb
dydx-0.1.41421 spec/lib/algebra/operator/parts/inverse_spec.rb
dydx-0.1.412 spec/lib/algebra/operator/parts/inverse_spec.rb
dydx-0.1.4 spec/lib/algebra/operator/parts/inverse_spec.rb