Java Reference
In-Depth Information
public static
type
reverse(
type
val)
Returns the value obtained by reversing the order of the bits
in
val
.
public static
type
rotateLeft(
type
val, int distance)
Returns the value obtained by rotating the bits in
val
to the
left. In a left rotation the high-order bit moved out on the left
becomes the lowest-order bit on the right. Rotating to the left
by a negative distance is the same as rotating to the right by
a positive distance.
public static
type
rotateRight(
type
val, int distance)
Returns the value obtained by rotating the bits in
val
to the
right. In a right rotation the low-order bit moved out on the
right becomes the highest-order bit on the left. Rotating to
the right by a negative distance is the same as rotating to the
left by a positive distance.
Finally, the
Integer
and
Long
classes also define the mathematical
signum
function. This function takes a value and returns 1, 0, or +1 as the value
is negative, zero, or positive, respectively.
8.4.2. The Floating-Point Wrapper Classes
The
Float
and
Double
classes extend
Number
to represent the
float
and
double
types as classes. With only a few exceptions, the names of the
methods and constants are the same for both types. In the following
list, the types for the
Float
class are shown, but
Float
and
float
can be
changed to
Double
and
double
, respectively, to get equivalent fields and
methods for the
Double
class. In addition to the standard
Number
meth-
ods,
Float
and
Double
have the following constants and methods:
public final static float
POSITIVE_INFINITY