getUnifiedNumberClassOrNull

internal fun getUnifiedNumberClassOrNull(first: KClass<*>?, second: KClass<*>, options: UnifiedNumberTypeOptions = UnifiedNumberTypeOptions.DEFAULT): KClass<*>?

Determines the nearest common numeric type, in terms of complexity, between two given classes/types.

Unsigned types are supported too even though they are not a Number instance, but unless two unsigned types are provided in the input, it will never be returned. Meaning, a single Number input, the output will always be a Number.

Return

The nearest common numeric type between the two input classes. If no common class is found, IllegalStateException is thrown.

Parameters

first

The first numeric type to compare. Can be null, in which case the second to is returned.

second

The second numeric to compare. Cannot be null.

See also