def Short.up

bend-kit-fmt@0.1.0.0 · fmt.bend:275

import bend-kit-fmt@0.1.0.0/fmt.bend as Fmt
import Base

275# k is the decimal exponent plus 64: v = 0.d1d2... * 10^(k - 64).
276def Short.up(f: Nat, +even: Bool, big: Bool, st: St, +k: U32) -> St & U32:
277  match f:
278    case 0n:
279      (st, k)
280    case 1n+g:
281      match big:
282        case False{}:
283          (st, k)
284        case True{}:
285          match st:
286            case St{r, s, mp, mm}:
287              +r1 = {r : List<&2, U32>}
288              +mp1 = {mp : List<&2, U32>}
289              +s10 = {Big.mul(s, 10, 0) : List<&2, U32>}
290              Short.up(g, even, Short.high(even, r1, mp1, s10),
291                St{r1, s10, mp1, mm}, U32.add(k, 1))

Uses (10)

Used by (1)