Skip to content

remove the cmath module, and remove the redundant layer of wrapper functions #12713

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

Closed
thestinger opened this issue Mar 5, 2014 · 6 comments · Fixed by #13331
Closed

remove the cmath module, and remove the redundant layer of wrapper functions #12713

thestinger opened this issue Mar 5, 2014 · 6 comments · Fixed by #13331
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@thestinger
Copy link
Contributor

Rust should expose the full standard C99 math library through the Float trait. The cmath module will then be an implementation detail we don't need to expose. This will allow Rust to move to a specific math library in the future too rather than using the standard C library provided by the OS.

At the moment, a macro is used to generate a whole bunch of wrappers around these functions. This actually makes the code longer, rather than shorter, so I don't see a point in keeping it around.

@ngsankha
Copy link
Contributor

Hasn't this been done already?

@thestinger
Copy link
Contributor Author

No, it's not done. The extra layer of wrappers is still there in the f32 and f64 modules and the cmath module also still exists.

@thestinger
Copy link
Contributor Author

The cmath module is now removed, but the duplicate free functions acting as wrappers still need to go.

@pongad
Copy link
Contributor

pongad commented Apr 4, 2014

Working on it

@thestinger
Copy link
Contributor Author

@pongad: By the way, I think some of these aren't yet exposed as methods on Float at all and they should be.

@pongad
Copy link
Contributor

pongad commented Apr 4, 2014

@thestinger I just found that out too. Will take care of it after today's exams are over :D

@bors bors closed this as completed in 60d3c08 Apr 5, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue May 17, 2024
make sure the msrv for `const_raw_ptr_deref` is met when linting [`missing_const_for_fn`]

fixes: rust-lang#8864

---

changelog: make sure the msrv for `const_ptr_deref` is met when linting [`missing_const_for_fn`]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants