From cad698568a36ea6c929b4c888bd5e8aafe8d39e3 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Wed, 4 Sep 2019 10:59:19 +0430 Subject: [PATCH] Use roundf to fix cast to int difference of msys2 w64 --- src/test-number.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test-number.cc b/src/test-number.cc index fb0c831af..74f905993 100644 --- a/src/test-number.cc +++ b/src/test-number.cc @@ -142,7 +142,7 @@ main (int argc, char **argv) double pv; assert (hb_parse_double (&pp, end, &pv)); - assert ((int) (pv * 1000.) == 123); + assert ((int) roundf (pv * 1000.) == 123); assert (pp - str == 4); assert (end - pp == 1); } @@ -154,7 +154,7 @@ main (int argc, char **argv) double pv; assert (hb_parse_double (&pp, end, &pv)); - assert ((int) (pv * 1000.) == 123); + assert ((int) roundf (pv * 1000.) == 123); assert (pp - str == 5); assert (end - pp == 0); } @@ -166,7 +166,7 @@ main (int argc, char **argv) double pv; assert (hb_parse_double (&pp, end, &pv)); - assert ((int) (pv * 1000.) == 123); + assert ((int) roundf (pv * 1000.) == 123); assert (pp - str == 7); assert (end - pp == 0); } @@ -178,7 +178,7 @@ main (int argc, char **argv) double pv; assert (hb_parse_double (&pp, end, &pv)); - assert ((int) (pv * 1000.) == 123); + assert ((int) roundf (pv * 1000.) == 123); assert (pp - str == 6); assert (end - pp == 0); } @@ -190,7 +190,7 @@ main (int argc, char **argv) double pv; assert (hb_parse_double (&pp, end, &pv)); - assert ((int) (pv * 1000.) == 123); + assert ((int) roundf (pv * 1000.) == 123); assert (pp - str == 10); assert (end - pp == 0); } @@ -202,7 +202,7 @@ main (int argc, char **argv) double pv; assert (hb_parse_double (&pp, end, &pv)); - assert ((int) (pv * 1000.) == -123); + assert ((int) roundf (pv * 1000.) == -123); assert (pp - str == 13); assert (end - pp == 0); } @@ -214,7 +214,7 @@ main (int argc, char **argv) double pv; assert (hb_parse_double (&pp, end, &pv)); - assert ((int) (pv * 1000.) == -123); + assert ((int) roundf (pv * 1000.) == -123); assert (pp - str == 8); assert (end - pp == 0); }