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

Improve Year.isLeap by checking divisibility by 16

    XMLWordPrintable

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: