-
-
Notifications
You must be signed in to change notification settings - Fork 402
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 methods with f64 std equivelant to Math object #260
Add methods with f64 std equivelant to Math object #260
Conversation
Hey this is awesome, thanks! |
@Nickforall looks ok, are you planning to add tests for these? |
Some errors Math.acosh(0.999999999999);
// expected output: NaN
Math.atanh(0.5);
// // expected output: 0.549306144334055 (approximately)
Looks like its not dealing with decimals properly. |
decimal number parsing is a bit messed up, only if 0 is the first number
|
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.
Commented and tested
Yeah sure, I’ll add some tests when i have time later this week :)
…On Fri, 6 Mar 2020 at 22:10, Jason Williams ***@***.***> wrote:
@Nickforall <https://github.com/Nickforall> looks ok, are you planning to
add tests for these?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<jasonwilliams#260?email_source=notifications&email_token=ABGBWMUDS4GFGOVT6LIJA63RGFRFHA5CNFSM4K2VMZCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOC3WYQ#issuecomment-595966818>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGBWMSX4JFQ7WH7FJEECCDRGFRFHANCNFSM4K2VMZCA>
.
|
We have mini-test suite for lexing numbers, looks like 0.1 should be added: |
This comment has been minimized.
This comment has been minimized.
Will rebase once #272 is merged. |
1d4fcfa
to
1f15cf6
Compare
Rebased and added test for all methods. The tests are largely based on the docs from Mozilla |
bcac991
to
d960870
Compare
d960870
to
8757016
Compare
Thanks for your contribution @Nickforall it looks good |
I implemented some more Math functions which already have an equivelant in the rust standard library. There are still a couple more that have to be implemented, but they require a bit more work as they have some side effects or are not in the rust standard library. Those are out of scope for this PR.
List of Math object functions