Range Parameters

Top  Previous  Next

Range parameters define a range of values that the parameter can be selected from. Range parameters are often the most useful dynamic parameters.


Range parameters are defined using the range command.


$p=range(low,high,increment (optional))




$p=range(1,100)                $p can take any (integer) value from 1 to 100.

$q=range(2,4.5,0.001)                $q can take any value from 2 to 4.5 in 0.001 increments.

$r=range(0,3pi,pi/4)                $r can take any value from 0 to 3π in increments of π/4. The values will be inserted as decimals.


You can also define double ranges using the rangeex command. This command allows you to create ranges which include positive and negative numbers without including 0. This is often useful in the design of algebra questions.


$p=rangeex(low,high,increment (optional))


$p=rangeex(2,5)                $p can take any of the integers {-5, -4, -3, -2, 2, 3, 4, 5}.