More soft Fraction.fromByteArray
This commit is contained in:
parent
1ea2361777
commit
a8811ae072
@ -639,7 +639,7 @@ data class Fraction @JvmOverloads constructor(@JvmField val value: BigInteger, @
|
|||||||
val offsetB = 1 + bytes[0].toInt()
|
val offsetB = 1 + bytes[0].toInt()
|
||||||
val bytesB = bytes.copyOfRange(offsetB + 1, offsetB + 1 + bytes[offsetB].toInt())
|
val bytesB = bytes.copyOfRange(offsetB + 1, offsetB + 1 + bytes[offsetB].toInt())
|
||||||
|
|
||||||
return Fraction(BigInteger(bytesA), BigInteger(bytesB))
|
return Fraction(if (bytesA.isNotEmpty()) BigInteger(bytesA) else BigInteger.ZERO, if (bytesB.isNotEmpty()) BigInteger(bytesB) else BigInteger.ZERO)
|
||||||
}
|
}
|
||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
|
Loading…
Reference in New Issue
Block a user