diff options
Diffstat (limited to 'stdlib/source/library/lux/math/number/rev.lux')
-rw-r--r-- | stdlib/source/library/lux/math/number/rev.lux | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/stdlib/source/library/lux/math/number/rev.lux b/stdlib/source/library/lux/math/number/rev.lux index 31aa1799b..6fed06ede 100644 --- a/stdlib/source/library/lux/math/number/rev.lux +++ b/stdlib/source/library/lux/math/number/rev.lux @@ -235,8 +235,8 @@ _ 1)) raw_size ("lux text size" raw_output) zero_padding (is Text - (loop [zeroes_left (is Nat (//nat.- raw_size max_num_chars)) - output (is Text "")] + (loop (again [zeroes_left (is Nat (//nat.- raw_size max_num_chars)) + output (is Text "")]) (if (//nat.= 0 zeroes_left) output (again (-- zeroes_left) @@ -295,9 +295,9 @@ (def: (digits#times_5! idx output) (-> Nat Digits Digits) - (loop [idx idx - carry 0 - output output] + (loop (again [idx idx + carry 0 + output output]) (if (//int.< +0 (.int idx)) output (let [raw (|> (..digit idx output) @@ -309,9 +309,9 @@ (def: (power_digits power) (-> Nat Digits) - (loop [times power - output (|> (..digits []) - (digits#put! power 1))] + (loop (again [times power + output (|> (..digits []) + (digits#put! power 1))]) (if (//int.< +0 (.int times)) output (again (-- times) @@ -319,9 +319,9 @@ (def: (format digits) (-> Digits Text) - (loop [idx (-- //i64.width) - all_zeroes? true - output ""] + (loop (again [idx (-- //i64.width) + all_zeroes? true + output ""]) (if (//int.< +0 (.int idx)) (if all_zeroes? "0" @@ -338,9 +338,9 @@ (def: (digits#+! param subject) (-> Digits Digits Digits) - (loop [idx (-- //i64.width) - carry 0 - output (..digits [])] + (loop (again [idx (-- //i64.width) + carry 0 + output (..digits [])]) (if (//int.< +0 (.int idx)) output (let [raw ($_ //nat.+ @@ -356,8 +356,8 @@ (let [length ("lux text size" input)] (if (//nat.> //i64.width length) {.#None} - (loop [idx 0 - output (..digits [])] + (loop (again [idx 0 + output (..digits [])]) (if (//nat.< length idx) (case ("lux text index" 0 ("lux text clip" idx 1 input) "0123456789") {.#None} @@ -370,7 +370,7 @@ (def: (digits#< param subject) (-> Digits Digits Bit) - (loop [idx 0] + (loop (again [idx 0]) (and (//nat.< //i64.width idx) (let [pd (..digit idx param) sd (..digit idx subject)] @@ -392,8 +392,8 @@ (def: (digits#-! param subject) (-> Digits Digits Digits) - (loop [idx (-- //i64.width) - output subject] + (loop (again [idx (-- //i64.width) + output subject]) (if (//int.< +0 (.int idx)) output (again (-- idx) @@ -409,8 +409,8 @@ input (let [last_idx (-- //i64.width)] - (loop [idx last_idx - digits (..digits [])] + (loop (again [idx last_idx + digits (..digits [])]) (if (//int.< +0 (.int idx)) ("lux text concat" "." (..format digits)) (if (//i64.one? idx input) @@ -434,9 +434,9 @@ (if (and dotted? within_limits?) (case (|> input ..decimals ..text_digits) {.#Some digits} - (loop [digits digits - idx 0 - output 0] + (loop (again [digits digits + idx 0 + output 0]) (if (//nat.< //i64.width idx) (let [power (power_digits idx)] (if (digits#< power digits) |