diff --git a/Nasal/bits.nas b/Nasal/bits.nas index 042dfd309..0af9bd242 100644 --- a/Nasal/bits.nas +++ b/Nasal/bits.nas @@ -29,9 +29,7 @@ var switch = func(n, b, v) n - (test(n, b) - !!v) * bit[b]; # returns number as bit string, zero-padded to digits: # bits.string(6) -> "110" # bits.string(6, 8) -> "00000110" -var string = func(n, len = 0) { - if (!n) - return '0'; +var string = func(n, len = 1) { var s = ""; while (n) { var v = int(n / 2);