Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8319423

Improve Year.isLeap by checking divisibility by 16

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 22
    • None
    • core-libs
    • None
    • b24

      The code for checking if a proleptic year is a leap year can be improved by using a quicker test for divisibility by 16 rather than % 400.

      The suggested improvement was inspired by the talk "Implementing Fast Calendar Algorithms" by Cassio Neri: https://www.youtube.com/watch?v=0s9F4QWAl-E

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: