while converting the Double value to Long, is type...
# getting-started
h
while converting the Double value to Long, is type overflow possible?
e
yes.
1e19.toLong()
gets truncated to
Long.MAX_VALUE
h
Truncation is not overflow but i got the point thank u. The fractional part, if any, is rounded down towards zero. Returns zero if this
Double
value is
NaN
, Long.MIN_VALUE if it’s less than
Long.MIN_VALUE
, Long.MAX_VALUE if it’s bigger than
Long.MAX_VALUE