I am trying to write a for loop, where I have to increment exponentially. I am using stride function but it won\'t work. Here\'s c++ code, I am trying to write a sw
stride
There is no for loop in Swift, but you can achieve the same result with basic while loop
for
while
var m = 1 // initializer while m <= high - low { // condition ... m *= 2 // iterator }