diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-07-25 13:25:40 +0200 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2021-08-11 20:59:51 +0200 |
| commit | c2255c6c19a07eabc4a015aab35b12a3cc31e312 (patch) | |
| tree | fce3a91dfab3b44b259562b3dc5c024763d9fbe2 /core/math/big/example.odin | |
| parent | 2884fa55060ba870b217d38f2e3d3129f1108a55 (diff) | |
big: Add `div`.
Diffstat (limited to 'core/math/big/example.odin')
| -rw-r--r-- | core/math/big/example.odin | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/math/big/example.odin b/core/math/big/example.odin index 103259b3e..ca3fc5531 100644 --- a/core/math/big/example.odin +++ b/core/math/big/example.odin @@ -68,6 +68,22 @@ demo :: proc() { print("quotient ", quotient, 10); fmt.println("remainder ", i); fmt.println("error", err); + + fmt.println(); fmt.println(); + + err = set (numerator, 15625); + err = set (denominator, 3); + err = zero(quotient); + + print("numerator ", numerator, 10); + print("denominator", denominator, 10); + + err = _int_div_small(quotient, remainder, numerator, denominator); + + print("quotient ", quotient, 10); + print("remainder ", remainder, 10); + + } main :: proc() { |