i128
crate feature now causes the build script to panic if such
support is not detected.Contributors: @cuviper
CheckedNeg
and CheckedRem
traits perform checked Neg
and
Rem
, returning Some(output)
or None
on overflow.no_std
implementation of FloatCore::to_degrees
for f32
now
uses a constant for greater accuracy, mirroring rust#47919. (With std
it
just calls the inherent f32::to_degrees
in the standard library.)MulAdd
and MulAddAssign
traits perform a fused multiply-
add. For integer types this is just a convenience, but for floating point
types this produces a more accurate result than the separate operations.i128
crate feature. The FromPrimitive
and ToPrimitive
traits now also have corresponding 128-bit methods, which
default to converting via 64-bit integers for compatibility.Contributors: @cuviper, @LEXUGE, @regexident, @vks
None
on overflow,
avoiding rustc's undefined behavior. This applies to the cast
function and the traits NumCast
, FromPrimitive
, and ToPrimitive
.Contributors: @apopiak, @cuviper, @dbarella
FloatCore
trait offers a subset of Float
for #![no_std]
use.
This includes everything except the transcendental functions and FMA.Inv
trait returns the multiplicative inverse, or reciprocal.Pow
trait performs exponentiation, much like the existing pow
function, but with generic exponent types.One::is_one
method tests if a value equals 1. Implementers
should override this method if there's a more efficient way to check for 1,
rather than comparing with a temporary one()
.Contributors: @clarcharr, @cuviper, @vks
std
feature, enabled by default, along
with the implication that building without this feature makes this a
#![no_std]
crate.
Float
and Real
traits are only available when std
is enabled.Contributors: @cuviper, @termoshtt, @vks
ParseFloatError
now implements Display
.AsPrimitive
trait implements generic casting with the as
operator.CheckedShl
and CheckedShr
traits implement generic
support for the checked_shl
and checked_shr
methods on primitive integers.Real
trait offers a subset of Float
functionality that may be applicable to more
types, with a blanket implementation for all existing T: Float
types.Thanks to @cuviper, @Enet4, @fabianschuiki, @svartalf, and @yoanlcq for their contributions!
No prior release notes were kept. Thanks all the same to the many contributors that have made this crate what it is!