1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #15964 from aabadie/pr/tests/driver_hih6130_fix_integer_absolute

tests/driver_hih6130: fix 'absolute-value' error
This commit is contained in:
Alexandre Abadie 2021-02-09 20:48:14 +01:00 committed by GitHub
commit 698a09f29d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -65,10 +65,10 @@ int main(void)
/* Split value into two integer parts for printing. */
fractional = modff(hum, &integral);
printf("humidity: %4d.%04u %%",
(int)integral, (unsigned int)abs(fractional * 10000.f));
(int)integral, (unsigned int)abs((int)(fractional * 10000.f)));
fractional = modff(temp, &integral);
printf(" temperature: %4d.%04u C\n",
(int)integral, (unsigned int)abs(fractional * 10000.f));
(int)integral, (unsigned int)abs((int)(fractional * 10000.f)));
}
return 0;