]> Cypherpunks repositories - gostls13.git/commit
math/bits: define Div to panic when y<=hi
authorBrian Kessler <brian.m.kessler@gmail.com>
Wed, 14 Nov 2018 05:51:21 +0000 (22:51 -0700)
committerKeith Randall <khr@golang.org>
Tue, 27 Nov 2018 05:04:33 +0000 (05:04 +0000)
commit979d9027aecf265214a6dcc27fe037bfd70355f2
treea750937318e7507bfb5797aabb0e8f3b664c5364
parent319787a528284aefe23424056a19bda71f7cc2b1
math/bits: define Div to panic when y<=hi

Div panics when y<=hi because either the quotient overflows
the size of the output or division by zero occurs when y==0.
This provides a uniform behavior for all implementations.

Fixes #28316

Change-Id: If23aeb10e0709ee1a60b7d614afc9103d674a980
Reviewed-on: https://go-review.googlesource.com/c/149517
Reviewed-by: Robert Griesemer <gri@golang.org>
src/math/bits/bits.go