-
Notifications
You must be signed in to change notification settings - Fork 224
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
add math module #357
add math module #357
Conversation
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.
Hooray another one! :-) Thanks @b5 for pushing this!
Looks almost perfect. Maybe just rename floatFunc
to floatFunc1
to match the other name and add the in radians
comment to the documentation of all trigonometric functions. It's missing for some functions at the end of the file. But it's only my two cent...
@b5 I take it over |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
@adonovan I believe that I have made all the requested changes except |
43666d8
to
f8a3101
Compare
a0ebf52
to
00e681c
Compare
@adonovan Fixed, please check again |
@adonovan all fixed, please check again |
It sounds that there is an issue with the build, the status is never reported |
@adonovan done, please check it again |
364dfe1
to
c1b7e05
Compare
@adonovan Done, I also added some new functions |
@adonovan done, please check again |
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.
Nearly there!
@adonovan done |
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.
Looks good. Many thanks.
Jon, can you merge this PR? It LGTM. |
The status check for CI never returned. Can you try force-pushing a new commit (e.g. with |
Actually looks like our travis CI integration method is deprecated. Will reconfigure on my side... |
Actually it looks like we've received status updates recently from this hook and the deprecation that article's talking about happened a while ago, so let's just force push and see if that fixes it. |
ok, force pushed, doesn't look like we're having any luck |
Hi! Sorry to barge in a little late. Am I correct in assuming that abs(9007199254740992+1) # = abs(1+2^53) does this fail? |
An int of any magnitude is converted to a float. This will fail if the magnitude is bigger than about 1e308. However, the result of math.abs is always a floating-point number, even if the argument was an integer. This is consistent with Python3, but it does argue in favor of renaming math.abs to math.fabs, both for consistency with Python, and to indicate that the result is a float. I'm not aware of how to compute abs of a big int in Python. We should also have a test for this. UPDATE: Ah, Python's |
I manually kicked off the travis build, and it finally worked. But now it seems we are missing the google cla check from one of the authors. @essobedo and @b5 - please see googlebot's comment above-791891376 - you would need to make a comment with the literal words |
Never mind, googlebot is now happy :) |
Thanks for taking care of the merge @tetromino. |
…am versions After a *large* community effort, we've successfully moved two packages from starlib into the "real" standard library in go-starlark: * math: google/starlark-go#357 * time: google/starlark-go#327 Both of these packages have had a great deal of vetting & improvement in the process of migrating. While this does introduce many breaking changes for both packages, both packages have better stability & performance characteristics. Moving forward, we'll try to follow the pattern of developing & testing packages here, and for those deemed worthy, move them up into go-starlark. Once a package lands there, we'll switch starlib to being a strict import-and-document-only, which effectively locks their API. Keeping package APIs locked will cut down on drift, benefitting the broader starlark ecosystem. BREAKING CHANGE: math & time modules have been overhauled. Refer to package documentation for details
…am versions After a *large* community effort, we've successfully moved two packages from starlib into the "real" standard library in go-starlark: * math: google/starlark-go#357 * time: google/starlark-go#327 In addition, both time & math imports have lost thier ".star" suffixes: load("time.star", "time") -> load("time", "time") load("math.star, "math") -> load("math", "math") Both of these packages have had a great deal of vetting & improvement in the process of migrating. While this does introduce many breaking changes for both packages, both packages have better stability & performance characteristics. Moving forward, we'll try to follow the pattern of developing & testing packages here, and for those deemed worthy, move them up into go-starlark. Once a package lands there, we'll switch starlib to being a strict import-and-document-only, which effectively locks their API. Keeping package APIs locked will cut down on drift, benefitting the broader starlark ecosystem. BREAKING CHANGE: math & time modules have been overhauled. Refer to package documentation for details
…am versions After a *large* community effort, we've successfully moved two packages from starlib into the "real" standard library in go-starlark: * math: google/starlark-go#357 * time: google/starlark-go#327 In addition, both time & math imports have lost thier ".star" suffixes: load("time.star", "time") -> load("time", "time") load("math.star, "math") -> load("math", "math") Both of these packages have had a great deal of vetting & improvement in the process of migrating. While this does introduce many breaking changes for both packages, both packages have better stability & performance characteristics. Moving forward, we'll try to follow the pattern of developing & testing packages here, and for those deemed worthy, move them up into go-starlark. Once a package lands there, we'll switch starlib to being a strict import-and-document-only, which effectively locks their API. Keeping package APIs locked will cut down on drift, benefitting the broader starlark ecosystem. BREAKING CHANGE: math & time modules have been overhauled. Refer to package documentation for details
closes #78.
cc @dustmop, @adonovan, & @essobedo