keith-turner commented on issue #987: Possible misleading calculation of 
notifications size in the queue is fixed.
URL: https://github.com/apache/fluo/pull/987#issuecomment-353684263
 
 
   This neat.  I learned something new today.  I had never really thought about 
this.  It seems obvious now, the cast for the return type happens last.  I 
created a little program to try this out.
   
   ```java
    public static int f1() {return 1<<30;}
   
    public static long f2() {return f1()+f1()+f1()+f1();}
   
    public static long f3() {return (long)f1()+f1()+f1()+f1();}
   
    public static void main(String[] args) {
     System.out.println(f2());
     System.out.println(f3());
   }
   ```
   
   which prints
   
   ```
   0
   4294967296
   ```
   
   The build failed, but I think its unrelated to this change I restarted the 
build.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to