def shr

cswap-bend-cli@0.1.0.0 · settings.bend:77

import cswap-bend-cli@0.1.0.0/settings.bend as Settings
import Base

77# Move the point n digits right (digits come from the fraction, zeros pad).
78def shr(n: Nat, neg: Bool, i: String, f: String) -> Dec:
79  match n f:
80    case 0n _:
81      canon(neg, i, f)
82    case 1n+p SNil{}:
83      shr(p, neg, i ++ "0", "")
84    case 1n+p SCon{c, t}:
85      shr(p, neg, i ++ SCon{c, SNil{}}, t)

Uses (6)

Used by (1)