use type-cast in stead of UINT64_C
This commit is contained in:
parent
02aa95c2b5
commit
9cfb6c3298
@ -690,7 +690,7 @@ static int test_mp_get_u64(void)
|
||||
DOR(mp_init_multi(&a, &b, NULL));
|
||||
|
||||
for (i = 0; i < (int)(MP_SIZEOF_BITS(uint64_t) - 1); ++i) {
|
||||
r = (UINT64_C(1) << (i+1)) - 1;
|
||||
r = ((uint64_t)1 << (i+1)) - 1;
|
||||
if (!r)
|
||||
r = UINT64_MAX;
|
||||
printf(" r = 0x%" PRIx64 " i = %d\r", r, i);
|
||||
|
@ -16,7 +16,7 @@ mp_err mp_set_double(mp_int *a, double b)
|
||||
cast.dbl = b;
|
||||
|
||||
exp = (int)((unsigned)(cast.bits >> 52) & 0x7FFu);
|
||||
frac = (cast.bits & ((UINT64_C(1) << 52) - UINT64_C(1))) | (UINT64_C(1) << 52);
|
||||
frac = (cast.bits & (((uint64_t)1 << 52) - (uint64_t)1)) | ((uint64_t)1 << 52);
|
||||
|
||||
if (exp == 0x7FF) { /* +-inf, NaN */
|
||||
return MP_VAL;
|
||||
|
Loading…
Reference in New Issue
Block a user