# Class: com.pnfsoftware.jeb.util.primitives.Longs

Utility methods for `long`s.

## Constructor: Longs


## Static Method: compareUnsigned
- parameter: `x`, type: `long`
- parameter: `y`, type: `long`
- return type: `int`

Description: Compare two longs as unsigned.
parameter: x: first value
parameter: y: second value
return: a negative value, zero, or a positive value if `x` is respectively below, equal         to, or above `y` in unsigned order

## Static Method: divUnsigned
- parameter: `dividend`, type: `long`
- parameter: `divisor`, type: `long`
- return type: `long`

Description: Divide two longs treated as unsigned.
parameter: dividend: dividend treated as unsigned
parameter: divisor: divisor treated as unsigned
return: the unsigned quotient

## Static Method: equals
- parameter: `a`, type: `java.lang.Long`
- parameter: `b`, type: `java.lang.Long`
- return type: `boolean`

Description: Safe equality.
parameter: a: may be null
parameter: b: may be null
return: true if both a and b are null or if their long values are equal

## Static Method: equals
- parameter: `a`, type: `java.lang.Long`
- parameter: `b`, type: `long`
- return type: `boolean`

Description: Safe equality.
parameter: a: may be null
parameter: b: value to compare with
return: true if a is not null and its long value equal to b

## Static Method: equals
- parameter: `a`, type: `long`
- parameter: `b`, type: `java.lang.Long`
- return type: `boolean`

Description: Safe equality.
parameter: a: value to compare with
parameter: b: may be null
return: true if b is not null and its long value equal to a

## Static Method: formatHexCollection
- parameter: `list`, type: `java.util.Collection<java.lang.Long>`
- return type: `java.lang.String`

Description: Uses a "0x" prefix, ", " separator.
parameter: list: collection of longs
return: the formatted hexadecimal collection

## Static Method: formatLongCollection
- parameter: `collection`, type: `java.util.Collection<java.lang.Long>`
- parameter: `radix`, type: `java.lang.Integer`
- parameter: `pfx`, type: `java.lang.String`
- parameter: `sfx`, type: `java.lang.String`
- parameter: `separator`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Format a collection of longs.
parameter: collection: collection of longs
parameter: radix: optional, default=10
parameter: pfx: optional, default=none
parameter: sfx: optional, default=none
parameter: separator: optional, default=", "
return: the formatted collection

## Static Method: fromInts
- parameter: `v0`, type: `int`
- parameter: `v1`, type: `int`
- return type: `long`

Description: Create a long from two ints. See [#toInts(long)](#toInts(long)) for the reverse operation.
parameter: v0: low 32 bits
parameter: v1: high 32 bits
return: the composed long value

## Static Method: maxUnsigned
- parameter: `x`, type: `long`
- parameter: `y`, type: `long`
- return type: `long`

Description: Retrieve the max of two longs treated as unsigned.
parameter: x: first value
parameter: y: second value
return: the greater unsigned value

## Static Method: minUnsigned
- parameter: `x`, type: `long`
- parameter: `y`, type: `long`
- return type: `long`

Description: Retrieve the min of two longs treated as unsigned.
parameter: x: first value
parameter: y: second value
return: the smaller unsigned value

## Static Method: range
- parameter: `start`, type: `long`
- parameter: `end`, type: `long`
- parameter: `step`, type: `long`
- return type: `java.lang.Iterable<java.lang.Long>`

Description: Generate an iterable range of integers.
parameter: start: first value, inclusive
parameter: end: exclusive
parameter: step: increment \(can be negative, cannot be zero\)
return: an iterable range

## Static Method: range
- parameter: `start`, type: `long`
- parameter: `end`, type: `long`
- return type: `java.lang.Iterable<java.lang.Long>`

Description: Generate an incremental range of integers.
parameter: start: first value, inclusive
parameter: end: exclusive
return: an iterable range

## Static Method: range
- parameter: `cnt`, type: `long`
- return type: `java.lang.Iterable<java.lang.Long>`

Description: Generate an incremental range of integers from 0 to the provided count.
parameter: cnt: exclusive upper bound
return: an iterable range from 0 to `cnt`

## Static Method: remUnsigned
- parameter: `dividend`, type: `long`
- parameter: `divisor`, type: `long`
- return type: `long`

Description: Get the division remainder of two longs treated as unsigned.
parameter: dividend: dividend treated as unsigned
parameter: divisor: divisor treated as unsigned
return: the unsigned remainder

## Static Method: toInts
- parameter: `v`, type: `long`
- return type: `int[]`

Description: Create two ints from a long. See [#fromInts(int, int)](#fromInts(int, int)) for the reverse operation.
parameter: v: long value
return: an array of two ints.

## Static Method: toUnsignedBigInteger
- parameter: `v`, type: `long`
- return type: `java.math.BigInteger`

Description: Convert a long treated as unsigned to a big integer.
parameter: v: long value
return: the unsigned value as a positive big integer

## Static Method: toUnsignedString
- parameter: `value`, type: `long`
- return type: `java.lang.String`

Description: Convert a long to its unsigned decimal string representation.
parameter: value: long value
return: the unsigned decimal representation of `value`

