mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
math.big: remove unnecessary code from / and % (the same is done in div_mod, which they call) (#24766)
This commit is contained in:
parent
25264e0fbe
commit
502f0e7e77
1 changed files with 0 additions and 8 deletions
|
@ -473,10 +473,6 @@ pub fn (dividend Integer) div_mod_checked(divisor Integer) !(Integer, Integer) {
|
|||
// refer to `div_checked`.
|
||||
@[inline]
|
||||
pub fn (dividend Integer) / (divisor Integer) Integer {
|
||||
if dividend.signum == -1 {
|
||||
q, _ := dividend.neg().div_mod(divisor)
|
||||
return q.neg()
|
||||
}
|
||||
q, _ := dividend.div_mod(divisor)
|
||||
return q
|
||||
}
|
||||
|
@ -489,10 +485,6 @@ pub fn (dividend Integer) / (divisor Integer) Integer {
|
|||
// In other words, the result is negative 3, and is NOT positive 4.
|
||||
@[inline]
|
||||
pub fn (dividend Integer) % (divisor Integer) Integer {
|
||||
if dividend.signum == -1 {
|
||||
_, r := dividend.neg().div_mod(divisor)
|
||||
return r.neg()
|
||||
}
|
||||
_, r := dividend.div_mod(divisor)
|
||||
return r
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue