Add a credit for Guava implementation of unsigned division and remainder

This commit is contained in:
Ilya Gorbunov
2018-08-16 08:05:57 +03:00
parent abdd971d92
commit 47162590eb
3 changed files with 210 additions and 1 deletions
@@ -12,7 +12,9 @@ internal fun ulongCompare(v1: Long, v2: Long): Int = (v1 xor Long.MIN_VALUE).com
internal fun uintDivide(v1: UInt, v2: UInt): UInt = (v1.toLong() / v2.toLong()).toUInt()
internal fun uintRemainder(v1: UInt, v2: UInt): UInt = (v1.toLong() % v2.toLong()).toUInt()
// TODO: Add reference to Guava implementation source
// Division and remainder are based on Guava's UnsignedLongs implementation
// Copyright 2011 The Guava Authors
internal fun ulongDivide(v1: ULong, v2: ULong): ULong {
val dividend = v1.toLong()
val divisor = v2.toLong()