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

provide bit-count method for int/long

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • x86
    • windows_2000



      Name: rmT116609 Date: 12/12/2003


      A DESCRIPTION OF THE REQUEST :
      There is a nice bit-count method in BigInteger.bitCnt(). It seems to be influenced by 'Hackers delight'. An average programmer would just code a simple loop for this. The classes (Short?), Integer, Long (maybe Math) should be extended to provide a public static method like bitCnt.


      JUSTIFICATION :
      Make nifty, rare known algorithms available for general use - it's already there - but package-local in BigInteger. The current implementation calls for (avoidable) cut-and-paste - if someone finds it...
      (Incident Review ID: 230602)
      ======================================================================

            Unassigned Unassigned
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: