Skip to content
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

Remove the dependency on libm #11624

Closed
40 tasks
brendanzab opened this issue Jan 17, 2014 · 7 comments
Closed
40 tasks

Remove the dependency on libm #11624

brendanzab opened this issue Jan 17, 2014 · 7 comments

Comments

@brendanzab
Copy link
Member

The functions that need to be implemented are:

  • cmath::c_float::ceil
  • cmath::c_float::trunc
  • cmath::c_float::acos
  • cmath::c_float::asin
  • cmath::c_float::atan
  • cmath::c_float::atan2
  • cmath::c_float::cbrt
  • cmath::c_float::copysign
  • cmath::c_float::cosh
  • cmath::c_float::exp_m1
  • cmath::c_float::abs_sub
  • cmath::c_float::next_after
  • cmath::c_float::frexp
  • cmath::c_float::hypot
  • cmath::c_float::ldexp
  • cmath::c_float::ln_1p
  • cmath::c_float::round
  • cmath::c_float::sinh
  • cmath::c_float::tan
  • cmath::c_float::tanh
  • cmath::c_double::ceil
  • cmath::c_double::trunc
  • cmath::c_double::acos
  • cmath::c_double::asin
  • cmath::c_double::atan
  • cmath::c_double::atan2
  • cmath::c_double::cbrt
  • cmath::c_double::copysign
  • cmath::c_double::cosh
  • cmath::c_double::exp_m1
  • cmath::c_double::abs_sub
  • cmath::c_double::next_after
  • cmath::c_double::frexp
  • cmath::c_double::hypot
  • cmath::c_double::ldexp
  • cmath::c_double::ln_1p
  • cmath::c_double::round
  • cmath::c_double::sinh
  • cmath::c_double::tan
  • cmath::c_double::tanh

Once this list has been completed we would be free to remove the std::num::cmath module.

@alexcrichton
Copy link
Member

I would be wary of defining these functions in libstd. I think that having libnum with a dependence on libm or defining these functions in libnum would certainly be acceptable.

@brendanzab
Copy link
Member Author

We have been discussing having an ieee754 lib. It would be super cool if the base numeric types could be de-magified and moved into a lib (see #11526). But again we would run into the issue of annoying users by not having CTFE.

@brendanzab
Copy link
Member Author

I might have a go at starting an IEEE754 library separate from the main rust repo, based on something like struct F32(u32); struct F64(u64);, and see how I go - then we can decide whether or not to include them in the std.

@brson
Copy link
Contributor

brson commented Jan 18, 2014

Although I do support the goal of modularizing std, I'm still not sure where I fall on this suggestion. Is there a BSD-licensed libm that is portable to everywhere that we can just link in to remove the external dependency?

@thestinger
Copy link
Contributor

We can provide the ability to use another libm without bringing it into the tree or adding a submodule. If Rust is going to be packaged for Debian and Fedora, it needs to move away from including third party libraries internally.

@thestinger
Copy link
Contributor

The LLVM intrinsics also call the C math symbols, so there's an inherent dependency on the C math library.

@thestinger
Copy link
Contributor

Closing in favour of #10774.

bors added a commit to rust-lang-ci/rust that referenced this issue Jul 25, 2022
fix: Don't show signature help after closing bracket

Stop showing signature help after closing angle/round brackets.

Fixes rust-lang#11624
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 21, 2023
…ut-unsafe-fn-block, r=blyxyas

Don't emit `needless_pass_by_ref_mut` if the variable is used in an unsafe block or function

Fixes rust-lang/rust-clippy#11586.
Fixes rust-lang/rust-clippy#11180.

As suggested in the two issues above, this lint should not be emitted if this an unsafe function or if the argument is used in an unsafe block.

changelog: [`needless_pass_by_ref_mut`]: Don't emit if the variable is used in an unsafe block or function
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

No branches or pull requests

4 participants