Hoverbear/rust-rosetta — pull request #165 by utkarshkukreti (2014-07-03 13:13:32+00:00)
Title: [Don't merge] Implement "Roots of a function" problem.

Opening this for discussion first.

The program output is correct, but the tests are failing with:

> task 'test_find_roots' failed at 'assertion failed: `(left == right) && (right == left)` (left: `[-0, 1, 2]`, right: `[0, 1, 2]`)', src/roots_of_a_function.rs:23

because -1.0 + 10000 times 0.0001 doesn't equal 0.0 exactly.

Does anyone have a suggestion on how to test this elegantly?