We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17eb99b commit 998e5e6Copy full SHA for 998e5e6
src/common/time/src/lib.rs
@@ -1,4 +1,3 @@
1
-#![feature(int_roundings)]
2
// Copyright 2023 Greptime Team
3
//
4
// Licensed under the Apache License, Version 2.0 (the "License");
src/common/time/src/timestamp.rs
@@ -143,7 +143,8 @@ impl Timestamp {
143
Some(Timestamp::new(value, unit))
144
} else {
145
let mul = unit.factor() / self.unit().factor();
146
- Some(Timestamp::new(self.value.div_ceil(mul as i64), unit))
+ let new_ts = self.value as f64 / mul as f64;
147
+ Some(Timestamp::new(new_ts.ceil() as i64, unit))
148
}
149
150
0 commit comments