Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment