verify that it is actually a number by any method you like most (this could be avoided depending on the regex at the previous point),
verify that it is in the range you're interested in, e.g. $x>=0 and $x<1.
This may seem slitghtly more verbose but should also more clear top read. It all depends on the restictions you want to impose on the input. For example are users allowd to input numbers in scientific notation?