Math.maxLong()

Signature

long maxLong (long a, long b)

Domain

action, condition

Description

Returns the greater of two long values. That is, the result is the argument closer to the value of Long.MAX_VALUE. If the arguments have the same value, the result is that same value.

Parameters

NameTypeDescription
alongAn argument.
blongAnother argument.

Returns

TypeDescription
longThe larger of a and b.

Cautions

none

See Also

java.lang.Long#MAX_VALUE

Example


String result = String.valueOfLong (Math.maxLong (4L, 29L));

Result is: result contains: "29"