diff options
| author | gingerBill <bill@gingerbill.org> | 2021-12-07 17:35:41 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-12-07 17:35:41 +0000 |
| commit | 9d4fe9035626f4f36ae84ca731ffc5fca00ebe17 (patch) | |
| tree | fd7cbc417bd554d847f5cb026da49b3474f6a9ea /core/math | |
| parent | 6ce5608003e630bc0de1c591fd4cbea3fe59e1d3 (diff) | |
Fix bugs in big.Rat caused by typos
Diffstat (limited to 'core/math')
| -rw-r--r-- | core/math/big/rat.odin | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/big/rat.odin b/core/math/big/rat.odin index 121f0ab50..837af6fd3 100644 --- a/core/math/big/rat.odin +++ b/core/math/big/rat.odin @@ -112,14 +112,14 @@ rat_set_u64 :: proc(dst: ^Rat, x: u64, allocator := context.allocator) -> (err: assert_if_nil(dst) context.allocator = allocator internal_set(&dst.a, x) or_return - internal_set(&dst.a, 1) or_return + internal_set(&dst.b, 1) or_return return } rat_set_i64 :: proc(dst: ^Rat, x: i64, allocator := context.allocator) -> (err: Error) { assert_if_nil(dst) context.allocator = allocator internal_set(&dst.a, x) or_return - internal_set(&dst.a, 1) or_return + internal_set(&dst.b, 1) or_return return } @@ -265,7 +265,7 @@ rat_mul_rat :: proc(dst, x, y: ^Rat, allocator := context.allocator) -> (err: Er return } - int_sub(&dst.a, &x.a, &y.a) or_return + int_mul(&dst.a, &x.a, &y.a) or_return internal_int_mul_denom(&dst.b, &x.b, &y.b) or_return return internal_rat_norm(dst) } |