handle the last value of res

This commit is contained in:
Francois Perrad 2018-12-01 08:35:22 +01:00
parent d7b7dfee53
commit 4d6a3cdc93
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ int mp_set_double(mp_int *a, double b)
}
res = (exp < 0) ? mp_div_2d(a, -exp, a, NULL) : mp_mul_2d(a, exp, a);
if (res != MP_OKAY) {
return res;
}
if (((cast.bits >> 63) != 0ULL) && (mp_iszero(a) == MP_NO)) {
SIGN(a) = MP_NEG;
}