Skip to content

Commit ad61b1a

Browse files
committed
Dot use scientific notation for ints
1 parent dfa3fb7 commit ad61b1a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sonyflake_turbo.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ const struct timespec default_start_time = {
3232
};
3333

3434
inline sonyflake_time to_sonyflake_time(const struct timespec *ts) {
35-
return ts->tv_sec * 100 + ts->tv_nsec / 1e7;
35+
return ts->tv_sec * 100 + ts->tv_nsec / 10000000;
3636
}
3737

3838
inline void from_sonyflake_time(sonyflake_time sf_time, struct timespec *ts) {
3939
ts->tv_sec = sf_time / 100;
40-
ts->tv_nsec = (sf_time % 100) * 1e7;
40+
ts->tv_nsec = (sf_time % 100) * 10000000;
4141
}
4242

4343
inline void sub_diff(struct timespec *a, const struct timespec *b) {
@@ -46,7 +46,7 @@ inline void sub_diff(struct timespec *a, const struct timespec *b) {
4646

4747
if (a->tv_nsec < 0) {
4848
a->tv_sec--;
49-
a->tv_nsec += 1e9;
49+
a->tv_nsec += 1000000000;
5050
}
5151
}
5252

0 commit comments

Comments
 (0)