Am 03.11.2023 um 22:01 schrieb Claes Redestad:

     public static boolean isLeap(long year) {
         return (year & 15) == 0 ? (year & 3) == 0 : (year & 3) == 0 && year % 
100 != 0;
     }

Not sure if this has any effect in terms of performance but not being a
fan of duplicated code, a variant would be

  return (year & 3) == 0 && (year & 15 == 0 || year % 100 != 0);


Cheers, Lothar

Reply via email to