Commit 8d427b7a authored by David Steinberg's avatar David Steinberg Committed by Damien George
Browse files

py: Fix issue in mpz_set_from_float() when mp_int_t is larger than float

parent c585ad10
......@@ -747,10 +747,16 @@ typedef uint32_t mp_float_int_t;
z->dig[dig_ind++] = (frc << shft) & DIG_MASK;
frc >>= DIG_SIZE - shft;
}
#if DIG_SIZE < (MP_FLOAT_FRAC_BITS + 1)
while (dig_ind != dig_cnt) {
z->dig[dig_ind++] = frc & DIG_MASK;
frc >>= DIG_SIZE;
}
#else
if (dig_ind != dig_cnt) {
z->dig[dig_ind] = frc;
}
#endif
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment