Closed dsvdmeer closed 3 years ago
Describe the bug When converting a BigInteger with a negative value to a Long using longValue(), it produces a positive result.
BigInteger
Long
longValue()
To Reproduce Steps to reproduce the behavior:
val bigInteger = (-12L).toBigInteger() val asLong = bigInteger.longValue(exactRequired = true) assertEquals(-12L, asLong) // Fails here
Expected behavior In the above example, asLong should equal -12.
asLong
-12
Platform
@dsvdmeer Thanks for reporting the issue! The fix should be available in snapshot version once the master branch build request is completed, in an hour or so barring any issues.
Describe the bug When converting a
BigInteger
with a negative value to aLong
usinglongValue()
, it produces a positive result.To Reproduce Steps to reproduce the behavior:
Expected behavior In the above example,
asLong
should equal-12
.Platform