Skip to content

Commit

Permalink
Tolerate imprecise result in SolvePoly
Browse files Browse the repository at this point in the history
The SolvePoly test TestSolvePoly generates a result that is slightly
imprecise on aarch64 (~2.75e-62) as opposed to a precise result on
x86_64.  This change adjusts the test to tolerate this imprecision.
  • Loading branch information
siddhesh authored and deadprogram committed Dec 7, 2019
1 parent 7592b34 commit e7c254d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1140,9 +1140,9 @@ func TestSolvePoly(t *testing.T) {

diffError := SolvePoly(coeffs, &roots, 300)

expectedDiffError := 0.0
if diffError != expectedDiffError {
t.Errorf("TestSolvePoly was not exact, got an error of %f and should have been %f", diffError, expectedDiffError)
diffTolerance := 1.0e-61
if diffError > diffTolerance {
t.Errorf("TestSolvePoly was not exact, got an error of %e and should have been less than %f", diffError, diffTolerance)
}

if roots.GetFloatAt(0, 0) != 7.0 {
Expand Down

0 comments on commit e7c254d

Please sign in to comment.