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

Upgraded math to C99 + bessel functions and replaced wrappers with imports #1440

Merged
merged 12 commits into from
Jan 5, 2012

Conversation

boggle
Copy link
Contributor

@boggle boggle commented Jan 5, 2012

  • added src/etc/cmathconsts.c for easy generation of per-arch constants when porting
  • needs tests but postponed till we have typeclasses
  • some renaming (predicates start with 'is_', log functions)
  • implemented most cmath macros using /slow/ rust functions to be replaced later

@kud1ing
Copy link

kud1ing commented Jan 5, 2012

needs tests but postponed till we have typeclasses

It seems, we have: https://mail.mozilla.org/pipermail/rust-dev/2012-January/001179.html

@boggle
Copy link
Contributor Author

boggle commented Jan 5, 2012

Yes but I feel reluctant to implement against them while they are still in a state of flux. Also we first need a bit of a plan how to use them for numeric types and in std and core in general (from_str, to_str stuff). And I'd need const support in typeclasses which really is not there right now.

@graydon
Copy link
Contributor

graydon commented Jan 5, 2012

Huh. Curious. Are the constants really per-arch? They seem to me like relatively stable mathematical concepts.

graydon added a commit that referenced this pull request Jan 5, 2012
Upgraded math to C99 + bessel functions and replaced wrappers with imports
@graydon graydon merged commit e02ab2d into rust-lang:master Jan 5, 2012
@boggle
Copy link
Contributor Author

boggle commented Jan 7, 2012

Well const support in type classes at first is necessary to have f32, f64, float versions of the mathematical constants (pi, e). In order to avoid loss of precision, it may be a good idea to provide these constants as loss free hexadecimal float literals (see #1443). This will ensure that rust's and C's idea of pi, e etc. are identical. Beyond that, libm is pretty generic in what kind of representation of floating point numbers is used by the C compiler (different radix, different size of mantissa, Non-IEEE formats). Thus again, to avoid loss of precision, on such a platform it may be desirable to give the constants in a loss-free form for that platform.

bjorn3 added a commit to bjorn3/rust that referenced this pull request Dec 31, 2023
Slightly reduce CI runtime and reduce log verbosity
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