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)
======================================================================
- duplicates
-
JDK-4172595 No way to determine # of bits in basic types
-
- Closed
-
-
JDK-4900166 static fields in java.lang wrappers for byte sizes (useful for NIO buffers)
-
- Resolved
-
- relates to
-
JDK-4495754 Add library support for common bit manipulation operations
-
- Resolved
-
-
JDK-4826652 Add copySign, nextAfter, nextUp, scalb, ilogb, etc. to Math and StrictMath
-
- Resolved
-
-
JDK-4633024 Augment Java math libraries with methods from C libm and IEEE 754
-
- Closed
-