uint icon indicating copy to clipboard operation
uint copied to clipboard

`from`: Correctly implement wrapping.

Open github-actions[bot] opened this issue 2 years ago • 0 comments

On 2022-06-11 @recmo wrote in e80cbc5 “Merge pull request #136 from recmo/small-devex”:

Correctly implement wrapping.

impl_from_signed_int!(isize, usize);

impl<const BITS: usize, const LIMBS: usize> TryFrom<f64> for Uint<BITS, LIMBS> {
    type Error = ToUintError<Self>;

    // TODO: Correctly implement wrapping.
    fn try_from(value: f64) -> Result<Self, Self::Error> {
        if value.is_nan() {
            return Err(ToUintError::NotANumber(BITS));
        }
        if value < 0.0 {

From src/from.rs:420

github-actions[bot] avatar Jun 11 '22 06:06 github-actions[bot]