Skip to content

Commit 20441ec

Browse files
committed
Use fmod instead of % for floating point modulo
Fixes #148
1 parent 2b5d415 commit 20441ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TimeClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,5 @@ long TimeClient::getCurrentEpoch() {
121121
}
122122

123123
long TimeClient::getCurrentEpochWithUtcOffset() {
124-
return round(getCurrentEpoch() + 3600 * myUtcOffset + 86400L) % 86400L;
124+
return fmod(round(getCurrentEpoch() + 3600 * myUtcOffset + 86400L), 86400L);
125125
}

0 commit comments

Comments
 (0)