Skip to content

Commit 7b09d01

Browse files
committed
fix compile error on MSVC
1 parent 4e90f31 commit 7b09d01

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

demo/test.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,15 +526,16 @@ static int test_mp_invmod(void)
526526
static int test_mp_set_double(void)
527527
{
528528
int i;
529+
double dbl_zero = 0.0;
529530

530531
mp_int a, b;
531532
DOR(mp_init_multi(&a, &b, NULL));
532533

533534
/* test mp_get_double/mp_set_double */
534-
EXPECT(mp_set_double(&a, +1.0/0.0) == MP_VAL);
535-
EXPECT(mp_set_double(&a, -1.0/0.0) == MP_VAL);
536-
EXPECT(mp_set_double(&a, +0.0/0.0) == MP_VAL);
537-
EXPECT(mp_set_double(&a, -0.0/0.0) == MP_VAL);
535+
EXPECT(mp_set_double(&a, +1.0/dbl_zero) == MP_VAL);
536+
EXPECT(mp_set_double(&a, -1.0/dbl_zero) == MP_VAL);
537+
EXPECT(mp_set_double(&a, +0.0/dbl_zero) == MP_VAL);
538+
EXPECT(mp_set_double(&a, -0.0/dbl_zero) == MP_VAL);
538539

539540
for (i = 0; i < 1000; ++i) {
540541
int tmp = rand_int();

0 commit comments

Comments
 (0)