-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
build-in: add sin,cos,tan build-in function #2830
Conversation
|
expression/builtin_math.go
Outdated
if err != nil { | ||
return d, errors.Trace(err) | ||
} | ||
d.SetFloat64(math.Cos(x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is COT
, not COS
.
expression/builtin_math_test.go
Outdated
} | ||
|
||
for _, test := range testCase { | ||
fc := funcs[ast.Sqrt] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will get a function of SQRT
.
Sorry, I copy that from SQRT function, but i forget to run go test. I am
immediately modified.
…On Wed, Mar 15, 2017 at 5:29 PM, Ewan Chou ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In expression/builtin_math_test.go
<#2830 (comment)>:
> +
+func (s *testEvaluatorSuite) TestSin(c *C) {
+ defer testleak.AfterTest(c)()
+
+ testCase := []struct {
+ arg interface{}
+ ret interface{}
+ }{
+ {math.Pi / 2, float64(1)},
+ {math.Pi, float64(1.2246467991473515e-16)},
+ {math.Pi / 3, float64(0.8660254037844387)},
+ {float64(1), float64(0.8414709848078965)},
+ }
+
+ for _, test := range testCase {
+ fc := funcs[ast.Sqrt]
This will get a function of SQRT.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2830 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALfcneVnxrr-cTbRw5G8uLQIhBX86Bucks5rl69tgaJpZM4MdrYn>
.
|
Please fix CI. |
@willxm |
No description provided.