Long.toBinaryString

Returns a string representation of the {@code long} argument as an unsigned integer in base 2.

<p>The unsigned {@code long} value is the argument plus 2<sup>64</sup> if the argument is negative; otherwise, it is equal to the argument. This value is converted to a string of ASCII digits in binary (base&nbsp;2) with no extra leading {@code 0}s.

<p>The value of the argument can be recovered from the returned string {@code s} by calling {@link Long#parseUnsignedLong(string, int) Long.parseUnsignedLong(s, 2)}.

<p>If the unsigned magnitude is zero, it is represented by a single zero character {@code '0'} ({@code '\u005Cu0030'}); otherwise, the first character of the representation of the unsigned magnitude will not be the zero character. The characters {@code '0'} ({@code '\u005Cu0030'}) and {@code '1'} ({@code '\u005Cu0031'}) are used as binary digits.

@param i a {@code long} to be converted to a string. @return the string representation of the unsigned {@code long} value represented by the argument in binary (base&nbsp;2). @see #parseUnsignedLong(string, int) @see #toUnsignedString(long, int)

class Long
static
string
toBinaryString
(
long i
)

Meta