Fix issues #50 and #55

This commit is contained in:
Ginger Bill
2017-04-29 20:06:29 +01:00
parent c7575164cc
commit 54ea70df98
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -156,7 +156,7 @@ shift_left :: proc(a: ^Decimal, k: uint) {
quo := n/10;
rem := n - 10*quo;
w--;
if w < len(a.digits) {
if 0 <= w && w < len(a.digits) {
a.digits[w] = cast(byte)('0' + rem);
} else if rem != 0 {
a.trunc = true;