def Decimal.frac.run
import bend-kit-bignum@0.1.0.0/decimal.bend as Decimalimport Base
import bend-kit-bignum@0.1.0.0/bigint.bend as Big
132def Decimal.frac.run(p: Big.BigInt & Big.BigInt) -> Maybe<&2, Decimal>:
133 (n, d) = p
134 +e = {d : Big.BigInt}
135 Decimal.frac.go(
136 (4n * String.length(Big.BigInt.show(e)) + 1n : Nat),
137 n, 0n, Decimal.is_one(e), Decimal.divk(e, 2), Decimal.divk(e, 5))