snuyanzin commented on code in PR #25897:
URL: https://github.com/apache/flink/pull/25897#discussion_r1957351774


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/utils/DateTimeUtils.java:
##########
@@ -1299,6 +1380,39 @@ private static long ceil(long a, long b) {
         }
     }
 
+    private static long ceil(long a, int b) {
+        float q = (float) b / NANOS_PER_MILLISECOND;

Review Comment:
   can you elaborate on this? This is not clear from the code.
   If I look at the code for this method
   ```java
    float q = (float) b / NANOS_PER_MILLISECOND;
   if (q > 0) {
       return a + 1L;
   } else {
       return a;
   }
   ```
   in the first line we are calculating `q` and then use the result in `if` 
condition
   ```java
    float q = (float) b / NANOS_PER_MILLISECOND;
   if (q > 0) {
    ...
   }
   ```
   thus having knowledge about sign of `b` we can answer what is the sign of 
`q` which is used in `if`.
   
   How can we answer similar question having knowledge about sign of `a` as you 
suggested?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to