RosettaCodeData/Task/Van-der-Corput-sequence/11l/van-der-corput-sequence.11l
2023-07-01 13:44:08 -04:00

10 lines
237 B
Text

F vdc(=n, base = 2)
V (vdc, denom) = (0.0, 1)
L n != 0
denom *= base
(n, V remainder) = divmod(n, base)
vdc += Float(remainder) / denom
R vdc
print((0.<10).map(i -> vdc(i)))
print((0.<10).map(i -> vdc(i, 3)))