AaronKutch / awint

Arbitrary width integers
Other
10 stars 0 forks source link

implement `arb_urem_` #15

Open AaronKutch opened 1 year ago

AaronKutch commented 1 year ago

I think it should be possible to have a function with the signature arb_urem_(duo: &mut Self, div: &Self, pad: &mut Self) -> Option<()>, the way it works in the general case is copying duo to pad, performing digit_udivide_inplace_ with it and the most significant digit bits of div plus 1, then using pad again as a temporary in a subtract-multiply step against duo, then repeating the whole process in a loop. There are probably edge cases when it gets close to the end, or maybe we can simply dd_divide that stuff.