195: Add support for euclidean division and modulation r=cuviper a=SparrowLii
Fixes#159
Add support for euclidean division and modulation.
Co-authored-by: SparrowLii <liyuancylx@gmail.com>
Co-authored-by: SparrowLii <liyuan179@huawei.com>
Co-authored-by: Josh Stone <cuviper@gmail.com>
218: Implement is_sign_* and signum methods in terms of bitcasts. r=cuviper a=ElectronicRU
# Rationale
[rust-gpu](/EmbarkStudios/rust-gpu) project uses num-traits directly and via glam. However, integer_decode() function is a bit poisonous for it - it immediately requires both Int16 and Int64 capabilities.
This PR reimplements corresponding functions in terms of libm's copysign. (For some reason, rust's libm is missing signbit - it can be done with a bitcast though, maybe that's actually a better implementation avenue).
Co-authored-by: Alex S <alex0player@gmail.com>
205: Add leading_ones and trailing_ones to PrimInt r=cuviper a=clarfonthey
Since this was only stabilised in 1.46.0, it falls back to a naïve version on older versions.
It seems unlikely that the version in libstd will ever be different from calling the zeros versions on !self, but for future-proofing, this defers to the libstd versions anyway.
Co-authored-by: ltdk <usr@ltdk.xyz>
210: Add LowerBounded/UpperBounded traits r=cuviper a=clarfonthey
Potential solution for #208. With a breaking change, these could simply become supertraits of `Bounded`, but until then, we have to deal with blanket implementations.
I added both simply because it was easy to do so, although we could opt to not require both. I don't see it being that negative to include both, however.
Co-authored-by: ltdk <usr@ltdk.xyz>
201: Use standard library for float from_str_radix with radix 10 r=cuviper a=tspiteri
Fixes#198.
While at it, also make parsing of the `"-NaN"` string match the standard library.
Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>