snuyanzin commented on code in PR #25897: URL: https://github.com/apache/flink/pull/25897#discussion_r1939132330
########## flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/DateTimeUtils.java: ########## @@ -1290,6 +1353,24 @@ private static long floor(long a, long b) { } } + private static long floor(long a, int b) { + long q = b / NANOS_PER_MILLISECOND; + if (q < 0) { + return a - q; + } else { + return a; + } + } + + private static int floorForHighPrecision(int b) { + long q = b / NANOS_PER_MICROSECOND; Review Comment: if we want to know the sign of the result we do not need to do this calculation it seems the whole method could be simplified to ```java return (q < 0 ? q - 1 : q) * NANOS_PER_MICROSECOND; ``` or did I miss anything? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org