Skip to content

Commit

Permalink
Improvements to 128bit division
Browse files Browse the repository at this point in the history
  • Loading branch information
ipfreely-uk committed Sep 23, 2024
1 parent af7b15b commit db4863a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ip/address6.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ func (a Addr6) Divide(denominator Addr6) Addr6 {
if isZero(denominator) {
panic("divide by zero")
}
if isOne(denominator) {
return a
}
compared := a.Compare(denominator)
if compared == 0 {
return Addr6{
Expand Down

0 comments on commit db4863a

Please sign in to comment.