wrong variable net only_msb_set to only_msb_unset in high(IntImpl)

This commit is contained in:
Mamy Ratsimbazafy 2018-05-17 09:43:41 +02:00 committed by GitHub
parent f2d0eab153
commit c588a84f19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -14,8 +14,8 @@ func high*[T](_: typedesc[IntImpl[T]]): IntImpl[T] {.inline.}=
# The lowest signed int has representation # The lowest signed int has representation
# 0b0111_1111_1111_1111 .... # 0b0111_1111_1111_1111 ....
# so we only have to unset the most significant bit. # so we only have to unset the most significant bit.
let only_msb_set = UintImpl[T].zero.not shr 1 let only_msb_unset = UintImpl[T].zero.not shr 1
result = cast[IntImpl[T]](only_msb_set) result = cast[IntImpl[T]](only_msb_unset)
func low*[T](_: typedesc[IntImpl[T]]): IntImpl[T] {.inline.}= func low*[T](_: typedesc[IntImpl[T]]): IntImpl[T] {.inline.}=