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

Package literals? EG: Integer.NUMBEROFBITS

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.1.6, 1.2.0
    • core-libs
    • generic
    • generic



      Name: dbT83986 Date: 02/10/99


      If I do anything vaguely low-level with Java's
      primitive types, I end up with some powers of
      two in my code. Would it not be clearer (esp.
      for novice programmers) to have constants such as
      Integer.NUMBEROFBITS rather than having to bear
      the actual numbers in mind?

      And though I can do without the above, it'd be
      nice to have bitmasks for IEEE floating-point,
      such as constants called e.g. SIGN, MANTISSA and
      EXPONENT in classes Float and Double (of type
      int and long respectively, and so accessible via
      floatToIntBits and doubleToLongBits). And having
      a constants so I don't have to remember that
      e.g. doubles have 53 bits precision would be
      nice too.

      (I see that the Win32 JDK has a class
      FloatDecimal with these constants already in:
      could they be moved/copied to some public
      classes?)
      (Review ID: 35635)
      ======================================================================

            darcy Joe Darcy
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: