summaryrefslogtreecommitdiff
path: root/contrib/ntp/tests/libntp/sfptostr.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-12-22 16:19:05 +0000
committerXin LI <delphij@FreeBSD.org>2016-12-22 16:19:05 +0000
commita9b4be204689211fddaab97ddd6df73b8f44d222 (patch)
treec763313cbeed3fb4c2eaab81925e4718bb6d5a62 /contrib/ntp/tests/libntp/sfptostr.c
parent6f2862ca3cb65eff13a8f228a0d447ecfc81cc68 (diff)
Notes
Diffstat (limited to 'contrib/ntp/tests/libntp/sfptostr.c')
-rw-r--r--contrib/ntp/tests/libntp/sfptostr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/ntp/tests/libntp/sfptostr.c b/contrib/ntp/tests/libntp/sfptostr.c
index c7616c7e3837..c781c03a4a07 100644
--- a/contrib/ntp/tests/libntp/sfptostr.c
+++ b/contrib/ntp/tests/libntp/sfptostr.c
@@ -39,7 +39,7 @@ void test_PositiveInteger(void)
void test_NegativeInteger(void)
{
- s_fp test = -200 << 16; // exact -200.000000
+ s_fp test = -(200 << 16); // exact -200.000000
TEST_ASSERT_EQUAL_STRING("-200.000000", fptoa(test, SFP_MAX_PRECISION));
TEST_ASSERT_EQUAL_STRING("-200000.000", fptoms(test, SFP_MAX_PRECISION));
@@ -55,7 +55,7 @@ void test_PositiveIntegerPositiveFraction(void)
void test_NegativeIntegerNegativeFraction(void)
{
- s_fp test = (-200 << 16) - (1 << 15); // -200 - 0.5
+ s_fp test = -(200 << 16) - (1 << 15); // -200 - 0.5
TEST_ASSERT_EQUAL_STRING("-200.500000", fptoa(test, SFP_MAX_PRECISION));
TEST_ASSERT_EQUAL_STRING("-200500.000", fptoms(test, SFP_MAX_PRECISION));
@@ -71,7 +71,7 @@ void test_PositiveIntegerNegativeFraction(void)
void test_NegativeIntegerPositiveFraction(void)
{
- s_fp test = (-200 << 16) + (1 << 14)*3; // -200 + 0.75
+ s_fp test = -(200 << 16) + (1 << 14)*3; // -200 + 0.75
TEST_ASSERT_EQUAL_STRING("-199.250000", fptoa(test, SFP_MAX_PRECISION));
TEST_ASSERT_EQUAL_STRING("-199250.000", fptoms(test, SFP_MAX_PRECISION));