From 84b84d9f7de0d17e74ca0b482f784497b509c282 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 11 Dec 2021 12:47:05 +0000 Subject: [PATCH] Fix `rat_set_f64` --- core/math/big/rat.odin | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/math/big/rat.odin b/core/math/big/rat.odin index 837af6fd3..c3efc30aa 100644 --- a/core/math/big/rat.odin +++ b/core/math/big/rat.odin @@ -42,9 +42,9 @@ rat_set_f64 :: proc(dst: ^Rat, f: f64, allocator := context.allocator) -> (err: dst.a.sign = .Negative if f < 0 else .Zero_or_Positive if shift > 0 { - internal_int_shl_digit(&dst.b, shift) or_return + internal_int_shl(&dst.b, &dst.b, shift) or_return } else { - internal_int_shl_digit(&dst.a, -shift) or_return + internal_int_shl(&dst.a, &dst.a, -shift) or_return } return internal_rat_norm(dst) @@ -389,9 +389,9 @@ internal_rat_to_float :: proc($T: typeid, z: ^Rat, allocator := context.allocato internal_int_abs(b2, b) or_return if shift := MSIZE2 - exp; shift > 0 { - internal_int_shl_digit(a2, shift) or_return - } else { - internal_int_shl_digit(b2, -shift) or_return + internal_int_shl(a2, a2, shift) or_return + } else if shift < 0 { + internal_int_shl(b2, b2, -shift) or_return } q, r := &Int{}, &Int{}