Skip to content

Commit

Permalink
Fix broken floating point comparison test
Browse files Browse the repository at this point in the history
  • Loading branch information
project-eutopia committed Feb 24, 2024
1 parent dc24763 commit ef98ade
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/keisan/differentiation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
context "single variable" do
it "can be used to assign variables" do
calculator.evaluate("my_func(x) = x*log(x)")
expect(calculator.evaluate("my_func(10)")).to eq(10 * Math::log(10))
expect(calculator.evaluate("replace(diff(my_func(x), x), x, 10)")).to eq(1 + Math::log(10))
expect(calculator.evaluate("my_func(10)")).to be_within(0.0001).of(10 * Math::log(10))
expect(calculator.evaluate("replace(diff(my_func(x), x), x, 10)")).to be_within(0.0001).of(1 + Math::log(10))
end
end

Expand Down

0 comments on commit ef98ade

Please sign in to comment.