longOrNull

open override val longOrNull: Long?(source)

The numeric value as Long if value is Long or Int; null for all other types.

On Kotlin/JS, is Int, is Float, and is Double cannot be distinguished in an Any? context, so the implementation uses a round-trip check: a Number is returned as Long only when its Double representation equals the Double of its truncated Long value (i.e. it has no fractional part).