Skip to content

Add more missing math functions #771

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

Merged
merged 3 commits into from
Jun 16, 2019

Conversation

kungfukennyg
Copy link
Contributor

As per issue #667 add missing functions for atan2, cosh, sinh, and tan. Also add f32 calls and tests for cbrt and hypot. Note that this does not make the num crates fully testable (ex: #770 )

This could be further cleaned up by condensing the f32 and f64 variants of each function into the same match arm. Or we could reduce even more code duplication wrt reading/writing floats similar to how intrinsics does so here: https://github.com/RalfJung/miri/blob/6a0d092eaf3150a4ae2e509744c49d5cadc60efc/src/intrinsic.rs#L188

Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go if CI is happy!

@kungfukennyg
Copy link
Contributor Author

Awesome. I wasn't sure about the windows name for hypotf so we'll see.

@RalfJung
Copy link
Member

Oh also, if you want to try something more like https://github.com/RalfJung/miri/blob/6a0d092eaf3150a4ae2e509744c49d5cadc60efc/src/intrinsic.rs#L188 that'd be great.

@RalfJung
Copy link
Member

CI looks happy. @kennethbgoodin did you want to try to share the float input/output code some more?

@kungfukennyg
Copy link
Contributor Author

Yes I am.

Add missing functions for atan2, cosh, sinh, and tan.
Also add f32 calls and tests for cbrt and hypot.
@kungfukennyg kungfukennyg force-pushed the foreign_math_functions branch from 985e463 to 46b6a3f Compare June 14, 2019 02:28
@RalfJung
Copy link
Member

Looks good except for the indentation.

In the future, please don't force-push unless you are resolving conflicts with a rebase.

@RalfJung RalfJung merged commit 14c4192 into rust-lang:master Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants