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

Package literals? EG: Integer.NUMBEROFBITS

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P5
    • Resolution: Duplicate
    • Affects Version/s: 1.1.6, 1.2.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description



      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)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: