Fuzion Logo
flang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

divide_with_remainder

🌌uint.divide_with_remainder

divide with remainder the two given positive ints
returns the quotient and the remainder
NYI performance: https://cs.opensource.google/go/go/+/refs/tags/go1.19:src/math/big/natdiv.go

The idea is to shift the divisor left as
far as possible so that the subtraction of this and
the shifted divisor is still positive.
This is done recursively and the results
are added up.