diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-09-20 23:17:33 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-09-20 23:17:33 +0100 |
| commit | d614913c112b68774d10853ff24e1a29fbd91ebb (patch) | |
| tree | f2eff1e3be453af0e9dcf46383d2a51a8eaaaaaf | |
| parent | 3bfaac08446e36caaf83fb2121abdbfeb04e261e (diff) | |
Fix decimal.odin, again
| -rw-r--r-- | core/decimal.odin | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/decimal.odin b/core/decimal.odin index 93a47bce9..398cc91fa 100644 --- a/core/decimal.odin +++ b/core/decimal.odin @@ -57,7 +57,7 @@ trim :: proc(a: ^Decimal) { assign :: proc(a: ^Decimal, i: u64) { - buf: [32]u8; + buf: [64]u8; n := 0; for i > 0 { j := i/10; @@ -68,10 +68,9 @@ assign :: proc(a: ^Decimal, i: u64) { } a.count = 0; - for n >= 0 { + for n -= 1; n >= 0; n -= 1 { a.digits[a.count] = buf[n]; a.count += 1; - n -= 1; } a.decimal_point = a.count; trim(a); |