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

tests/driver_hih6130: fix 'absolute-value' error

This commit is contained in:
Alexandre Abadie 2021-02-09 15:57:48 +01:00
parent 5fba2c8387
commit 2e3488154c

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;