and, just quickly. a script showing the “factor of 10” solution (just in case anyone is interested)
set x to 10
set bin_width to 1
set x_list to {}
repeat with x_ from 0 to x by bin_width
log "x_ is now " & x_
set x_div to x_ / 10
set x_list to x_list & x_div
end repeat
log "x_list is " & x_list
set x to 1
set bin_width to 0.1
set x_list to {}
set x_ to 0
repeat until x < x_
set x_ to x_ + bin_width
log "x_ is now " & x_
set x_list to x_list & x_
end repeat
i see that you are adding the decimal ( + sign ) rather than using “by”. I guess that means that it was “by” that was forcing the rounding error.
is this correct?
I modified the script a little. The final value in the list was (x + bin_width) (i.e. 1.1 where bin_with equals 0.1). so i negated this by adding bin_width to x_. conversely i could have subtracted bin_width from x on the left hand side of the less than sign.
thanks again!
set x to 1
set bin_width to 0.1
set x_list to {}
set x_ to 0
repeat until x < x_ + bin_width
set x_ to x_ + bin_width
log "x_ is now " & x_
set x_list to x_list & x_
end repeat