def fm_go
bend-collections@1.0.0.0 · src/math/f64.bend:1061
import bend-collections@1.0.0.0/src/math/f64.bend as F64
import Base
import bend-collections@1.0.0.0/src/math/u64.bend as W
import bend-collections@1.0.0.0/src/math/w64.bend as X
1061
1062
1063def fm_go(fuel: Nat, +b: W.U64, +d: Nat, st: W.U64 & W.U64) -> W.U64 & W.U64:
1064 match fuel d:
1065 case 0n _:
1066 st
1067 case 1n+f 0n:
1068 st
1069 case 1n+f 1n+e:
1070 fm_go(f, b, Nat.sub(1n+e, Nat.min(1n+e, 10n)), X.divmod(X.shl(X.psnd(st), Nat.min(1n+e, 10n)), b))