Commit Graph

24 Commits

Author SHA1 Message Date
Josh Stone d2bf4e04e4 Run cargo fmt 2018-07-12 17:09:22 -07:00
Corey Farwell 4775dee66b Clarify in the docs that `mul_add` is not always faster.
More info:

- https://github.com/rust-lang/rust/issues/49842
- https://github.com/rust-lang/rust/pull/50572
2018-05-20 11:58:10 -04:00
Josh Stone 6aaff332d3 Explicitly test FloatCore in to_degrees_rounding 2018-05-04 12:19:23 -07:00
Vinzent Steinberg 9ca219c677 Avoid test failure with Rust 1.8 by limiting to no-std builds 2018-04-10 19:56:39 +02:00
Vinzent Steinberg 6430351e74 Use constant for 180/π in f32::to_degrees
The current `f32::to_degrees` implementation uses a division to
calculate 180/π, which causes a loss of precision. Using a constant is
still not perfect (implementing a maximally-precise algorithm would come
with a high performance cost), but improves precision with a minimal
change.

This is a backport from [`std`].

[`std`]: e34c31bf02
2018-04-10 15:26:14 +02:00
Josh Stone 04a3f2a591 Comment the Rust version for NAN.is_sign_* behavior 2018-02-28 11:43:55 -08:00
Josh Stone 080f6f259e Comment the i32::MIN case for FloatCore::powi 2018-02-28 11:33:34 -08:00
Josh Stone aa9ceba628 Add doctests to FloatCore 2018-02-27 22:12:37 -08:00
Josh Stone ec3cd50f3d Weaken the std f32::to_degrees/to_radians tests 2018-02-27 22:10:46 -08:00
Josh Stone 36c7e324db Fix FloatCore::powi with i32::MIN exponent 2018-02-27 21:34:01 -08:00
Josh Stone 964a7e52a8 Reinstate NAN-sign fixes in FloatCore
Formerly changed on the next branch, part of rust-num/num#319.
2018-02-27 21:03:30 -08:00
Josh Stone 6fa29be7c0 Use macros for more float constants 2018-02-27 17:09:43 -08:00
Josh Stone 83d498d0be Add integer_decode to FloatCore 2018-02-27 16:33:04 -08:00
Josh Stone f365a4205f Add rounding methods to FloatCore 2018-02-27 16:33:04 -08:00
Josh Stone 99c6cc11ba Add more constants to FloatCore 2018-02-27 16:33:04 -08:00
Josh Stone 7d6575da0f Add NumCast to FloatCore, matching Float 2018-02-27 16:33:04 -08:00
Josh Stone ac503261ca Forward FloatCore to inherent methods when possible 2018-02-27 16:33:04 -08:00
Josh Stone c848562fcf Use forwarding macros to implement Float and Real 2018-02-27 16:33:04 -08:00
Vinzent Steinberg d115dadeb1 Don't re-export FloatCore
This avoids breaking `use num_traits::*`.
2018-02-07 12:42:30 +01:00
Vinzent Steinberg 1db660ed56 Inline only actual trait implementations 2018-02-07 12:38:01 +01:00
Vinzent Steinberg efad5329b4 Rename CoreFloat to FloatCore 2018-02-07 12:34:14 +01:00
Vinzent Steinberg 8a7f383eb1 Implement CoreFloat trait
This is a subset of the `Float` trait, but works with `no_std`.
Some code was simplified by using `CoreFloat`.
2018-02-02 19:48:25 +01:00
Josh Stone e6bb97b3ac Make `Float` and `Real` depend on the `std` feature
We don't have implementations for many of the methods in `no_std`.  It's
hostile to external implementors if some trait methods are conditional
on a feature, as that feature could be added by anyone in a dependency
tree.  Instead, let's just live without these traits for now.
2018-01-31 15:56:06 -08:00
Josh Stone 42a610d323 Move num-traits to its own repo
All the prior `num` history is kept, so old `num-traits` tags are still
valid, but future development here will be just for `num-traits`.
2017-12-18 17:35:41 -08:00