]> Cypherpunks repositories - gostls13.git/commit
math/cmplx: prevent infinite loop in tanSeries
authorMohit Agarwal <mohit@sdf.org>
Tue, 25 Oct 2016 14:03:50 +0000 (19:33 +0530)
committerRobert Griesemer <gri@golang.org>
Tue, 25 Oct 2016 18:32:22 +0000 (18:32 +0000)
commit5a9549260df1f5ffcbdd5938861fea9f74478661
tree395da6112e604b2ea6002dbc1f027fff26b9cfbd
parenta2f77e9ef8ba2e956453ad0dda1ebdf4ae7c4fdb
math/cmplx: prevent infinite loop in tanSeries

The condition to determine if any further iterations are needed is
evaluated to false in case it encounters a NaN. Instead, flip the
condition to keep looping until the factor is greater than the machine
roundoff error.

Updates #17577

Change-Id: I058abe73fcd49d3ae4e2f7b33020437cc8f290c3
Reviewed-on: https://go-review.googlesource.com/31952
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/cmplx/cmath_test.go
src/math/cmplx/tan.go