I am trying to replicate this for loop from some JS code.
for(var i = 1; i < power; i *=2)
But this (obviously) does not work:
for i in 1.stride(to: power, step: i*2)
I get unresolved identifier
. Let's say power
was 256, then I'd expect the sequence for i
to be 1,2,4,8,16,32,64,128
.