[Swift-devel] Foreach with floats

David Kelly davidk at ci.uchicago.edu
Tue Jul 17 13:30:59 CDT 2012


Hello,

Is it possible to use foreach with floating point numbers? Right now I can do something like this using ints:

foreach i in [0:10] {
   tracef("i is %i\n", i);
}

Is it possible to do something similar with floats using some delta value? For example, for every value between 0.0 and 10.0 in increments of 0.5?

David



More information about the Swift-devel mailing list