Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math/cmplx: unused test table vc26 #14890

Closed
dominikh opened this issue Mar 20, 2016 · 3 comments
Closed

math/cmplx: unused test table vc26 #14890

dominikh opened this issue Mar 20, 2016 · 3 comments

Comments

@dominikh
Copy link
Member

cmath_test.go in math/cmplx has a table called vc26 that isn't used anywhere and never has been.

Does this data serve any purpose? Should tests be added that make use of it, should it be removed, or does it act as documentation? Also, what's the meaning of the variable name?

This came up in https://go-review.googlesource.com/#/c/20913

The table:

var vc26 = []complex128{
    (4.97901192488367350108546816 + 7.73887247457810456552351752i),
    (7.73887247457810456552351752 - 0.27688005719200159404635997i),
    (-0.27688005719200159404635997 - 5.01060361827107492160848778i),
    (-5.01060361827107492160848778 + 9.63629370719841737980004837i),
    (9.63629370719841737980004837 + 2.92637723924396464525443662i),
    (2.92637723924396464525443662 + 5.22908343145930665230025625i),
    (5.22908343145930665230025625 + 2.72793991043601025126008608i),
    (2.72793991043601025126008608 + 1.82530809168085506044576505i),
    (1.82530809168085506044576505 - 8.68592476857560136238589621i),
    (-8.68592476857560136238589621 + 4.97901192488367350108546816i),
}

/cc @griesemer @bradfitz

@cldorian
Copy link
Contributor

It can be deleted, but might be useful. I used it originally, when developing the tests, for a 26-significant-figure test vector when calculating expected answers. I didn't want rounding to degrade the accuracy. The comment starting on line 37 explains the procedure.

The test vector for math/all_test.go was called "vf[]", so I called the complex test vector "vc[]"; vc26[] is the version of that test vector fed into the high-precision calculator.

@griesemer
Copy link
Contributor

Let's leave it. They don't do any harm. I will add a respective comment and close the issue.

@gopherbot
Copy link

CL https://golang.org/cl/20977 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants