lapack/gonum: prevent division of untyped ints always yielding zero in Dlasy2#1653
lapack/gonum: prevent division of untyped ints always yielding zero in Dlasy2#1653vladimir-ch merged 2 commits intogonum:masterfrom soypat:divz
Conversation
kortschak
left a comment
There was a problem hiding this comment.
This branch is not tested, so it would be nice if we could get an input that exercises this case.
Codecov Report
@@ Coverage Diff @@
## master #1653 +/- ##
=======================================
Coverage 73.22% 73.22%
=======================================
Files 504 504
Lines 59811 59811
=======================================
Hits 43794 43794
Misses 13537 13537
Partials 2480 2480
Continue to review full report at Codecov.
|
|
Should I close this request and let someone experienced with the function test this? I've tried giving input that's large enough to trigger the condition but it results in errors all over the place. I'm unfamiliar with what it is that is being tested. Here's what I tried: // declare tl, tr, b etc. in dlasy2.go in testlapack
for i := range tl.Data {
tl.Data[i] = math.Abs(tl.Data[i]) * 1e-10
}
if len(b.Data) > 0 {
b.Data[0] = 1e64
} |
No, you found the bug and the fix is clear even without having it covered by a test. After you've added yourself to CONTRIBUTORS/AUTHORS, I'll merge this PR and then try to take a look at the test. |
Please take a look at the line I changed. The following operation:
always yields zero. I added decimal points to
1and8to fix this undesired behavior.