MDN - Math.random() says the function returns a a floating-point number in the range 0 to less than 1 (inclusive of 0, but not 1), MDN doesn't describe in math expression.
I am not sure it make sense or better, change a random value [0-1] to a random value [0-1) , a random value [0~1) or a random value [0,1).
How about Sets the x and y components of this vector to a random value in the range 0 to less than 1 (inclusive of 0, but not 1).
I would prefer [0, 1) which is the correct mathematical definition for the value range of Math.random().
I suggest the following simple statement, which I think is adequate:
Sets each component of this vector to a pseudo-random value in [0, 1).
I wouldn't think mathematicians are the target users of the library...
I wouldn't know what [0, 1) means. I think it's helpful to say a value between 0 and 1, excluding 1.
2nd attempt: :-)
Sets each component of this vector to a pseudo-random value between 0 and 1, excluding 1.
My simple brain can understand that! 馃榿馃憣
Most helpful comment
I wouldn't think mathematicians are the target users of the library...
I wouldn't know what [0, 1) means. I think it's helpful to say a value between 0 and 1, excluding 1.