Skip to content
Snippets Groups Projects
Commit 109d2ff8 authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

Avoid casting from double to int

parent 47fd949c
No related branches found
No related tags found
2 merge requests!54Develop,!52Avoid casting from double to int
Pipeline #35500 passed
......@@ -104,9 +104,10 @@ secofday_decode(double secondOfDay)
{
CdiTime time;
const int fullSeconds = (int) secondOfDay;
double secondOfDayIntegral;
time.ms = lround(modf(secondOfDay, &secondOfDayIntegral) * 1000);
time.ms = (int) lround((secondOfDay - fullSeconds) * 1000);
const int fullSeconds = lrint(secondOfDayIntegral);
const int hour = fullSeconds / 3600;
const int minute = fullSeconds / 60 - hour * 60;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment