|
static int | bitCount (long long value) |
| Returns the number of one-bits in the two's complement binary representation of the specified int value. More...
|
|
static Long | decode (const String &value) |
| Decodes a String into a Long. More...
|
|
static long long | highestOneBit (long long value) |
| Returns an long long value with at most a single one-bit, in the position of the highest-order ("leftmost") one-bit in the specified int value. More...
|
|
static long long | lowestOneBit (long long value) |
| Returns an long long value with at most a single one-bit, in the position of the lowest-order ("rightmost") one-bit in the specified int value. More...
|
|
static int | numberOfLeadingZeros (long long value) |
| Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified long long value. More...
|
|
static int | numberOfTrailingZeros (long long value) |
| Returns the number of zero bits following the lowest-order ("rightmost") one-bit in the two's complement binary representation of the specified long long value. More...
|
|
static long long | parseLong (const String &value) |
| Parses the string argument as a signed decimal long. More...
|
|
static long long | parseLong (const String &value, int radix) |
| Returns a Long object holding the value extracted from the specified string when parsed with the radix given by the second argument. More...
|
|
static long long | reverseBytes (long long value) |
| Returns the value obtained by reversing the order of the bytes in the two's complement representation of the specified long long value. More...
|
|
static long long | reverse (long long value) |
| Returns the value obtained by reversing the order of the bits in the two's complement binary representation of the specified long long value. More...
|
|
static long long | rotateLeft (long long value, int distance) |
| Returns the value obtained by rotating the two's complement binary representation of the specified value left by the specified number of bits. More...
|
|
static long long | rotateRight (long long value, int distance) |
| Returns the value obtained by rotating the two's complement binary representation of the specified value right by the specified number of bits. More...
|
|
static int | signum (long long value) |
| Returns the signum function of the specified value. More...
|
|
static std::string | toString (long long value) |
| Converts the long to a String representation. More...
|
|
static std::string | toString (long long value, int radix) |
|
static std::string | toHexString (long long value) |
| Returns a string representation of the integer argument as an unsigned integer in base 16. More...
|
|
static std::string | toOctalString (long long value) |
| Returns a string representation of the long long argument as an unsigned long long in base 8. More...
|
|
static std::string | toBinaryString (long long value) |
| Returns a string representation of the long long argument as an unsigned long long in base 2. More...
|
|
static Long | valueOf (long long value) |
| Returns a Long instance representing the specified int value. More...
|
|
static Long | valueOf (const String &value) |
| Returns a Long object holding the value given by the specified std::string. More...
|
|
static Long | valueOf (const String &value, int radix) |
| Returns a Long object holding the value extracted from the specified std::string when parsed with the radix given by the second argument. More...
|
|
Decodes a String into a Long.
Accepts decimal, hexadecimal, and octal numbers given by the following grammar:
The sequence of characters following an (optional) negative sign and/or radix specifier ("0x", "0X", "#", or leading zero) is parsed as by the Integer.parseInteger method with the indicated radix (10, 16, or 8). This sequence of characters must represent a positive value or a NumberFormatException will be thrown. The result is negated if first character of the specified String is the minus sign. No whitespace characters are permitted in the string.
- Parameters
-
value | - The string to decode |
- Returns
- a Long object containing the decoded value
- Exceptions
-
NumberFomatException | if the string is not formatted correctly. |
static int decaf::lang::Long::numberOfLeadingZeros |
( |
long long |
value | ) |
|
|
static |
Returns the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified long long value.
Returns 64 if the specified value has no one-bits in its two's complement representation, in other words if it is equal to zero.
Note that this method is closely related to the logarithm base 2. For all positive int values x:
* floor( log2(x)) = 63 - numberOfLeadingZeros(x)
* ceil( log2(x)) = 64 - numberOfLeadingZeros(x - 1)
- Parameters
-
value | - the long long to be inspected |
- Returns
- the number of zero bits preceding the highest-order ("leftmost") one-bit in the two's complement binary representation of the specified long long value, or 64 if the value is equal to zero.
static long long decaf::lang::Long::parseLong |
( |
const String & |
value | ) |
|
|
static |
Parses the string argument as a signed decimal long.
The characters in the string must all be decimal digits, except that the first character may be an ASCII minus sign '-' to indicate a negative value. The resulting long value is returned, exactly as if the argument and the radix 10 were given as arguments to the parseLong(java.lang.String, int) method.
Note that the characters LL or ULL are not permitted to appear at the end of this string as would normally be permitted in a C++ program.
- Parameters
-
- Returns
- long long value
- Exceptions
-
NumberFormatException | on invalid string value |
static long long decaf::lang::Long::rotateLeft |
( |
long long |
value, |
|
|
int |
distance |
|
) |
| |
|
static |
Returns the value obtained by rotating the two's complement binary representation of the specified value left by the specified number of bits.
(Bits shifted out of the left hand, or high-order, side reenter on the right, or low-order.)
Note that left rotation with a negative distance is equivalent to right rotation: rotateLeft(val, -distance) == rotateRight(val, distance). Note also that rotation by any multiple of 32 is a no-op, so all but the last five bits of the rotation distance can be ignored, even if the distance is negative: rotateLeft(val, distance) == rotateLeft(val, distance & 0x1F).
- Parameters
-
value | - the long long to be inspected |
distance | - the number of bits to rotate |
- Returns
- the value obtained by rotating the two's complement binary representation of the specified value left by the specified number of bits.
static long long decaf::lang::Long::rotateRight |
( |
long long |
value, |
|
|
int |
distance |
|
) |
| |
|
static |
Returns the value obtained by rotating the two's complement binary representation of the specified value right by the specified number of bits.
(Bits shifted out of the right hand, or low-order, side reenter on the left, or high-order.)
Note that right rotation with a negative distance is equivalent to left rotation: rotateRight(val, -distance) == rotateLeft(val, distance). Note also that rotation by any multiple of 32 is a no-op, so all but the last five bits of the rotation distance can be ignored, even if the distance is negative: rotateRight(val, distance) == rotateRight(val, distance & 0x1F).
- Parameters
-
value | - the long long to be inspected |
distance | - the number of bits to rotate |
- Returns
- the value obtained by rotating the two's complement binary representation of the specified value right by the specified number of bits.
static std::string decaf::lang::Long::toHexString |
( |
long long |
value | ) |
|
|
static |
Returns a string representation of the integer argument as an unsigned integer in base 16.
The unsigned integer value is the argument plus 2^32 if the argument is negative; otherwise, it is equal to the argument. This value is converted to a string of ASCII digits in hexadecimal (base 16) with no extra leading 0s. If the unsigned magnitude is zero, it is represented by a single zero character '0'; otherwise, the first character of the representation of the unsigned magnitude will not be the zero character. The following characters are used as hexadecimal digits:
0123456789abcdef
If uppercase letters are desired, the toUpperCase() method may be called on the result:
- Parameters
-
value | - the long long to be translated to an Octal string |
- Returns
- the unsigned long long value as a Octal string
static std::string decaf::lang::Long::toOctalString |
( |
long long |
value | ) |
|
|
static |
Returns a string representation of the long long argument as an unsigned long long in base 8.
The unsigned long long value is the argument plus 2^32 if the argument is negative; otherwise, it is equal to the argument. This value is converted to a string of ASCII digits in octal (base 8) with no extra leading 0s.
If the unsigned magnitude is zero, it is represented by a single zero character '0'; otherwise, the first character of the representation of the unsigned magnitude will not be the zero character. The following characters are used as octal digits:
01234567
- Parameters
-
value | - the long long to be translated to an Octal string |
- Returns
- the unsigned long long value as a Octal string