This project is read-only.

Floating point range

The floating point range operator (the tilde, ~) creates an array of floating point numbers by initial value, finishing value and step.

var start = 0
var step = 0.1
var end = 1
var range = start ~ step ~ end
print range // "[ 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1]" 

To use an expression in the floating point range operator, it must be wrapped with parens.

Last edited Mar 17, 2011 at 12:07 AM by impworks, version 1

Comments

No comments yet.