Answer the question
In order to leave comments, you need to log in
What function can produce random values from 0 to 1 of different lengths?
There is a pseudo-random sequence of numbers, all are fractions of 1. After the point in most cases there are 14 digits, but sometimes there are 15 or vice versa 13 digits. I don't see any dependency, except that numbers that start with 0.0... usually have 15 digits after the decimal point.
What randomization function or several functions can result in these numbers?
I'm sure that the respected public knows what the numbers look like (author's note - LOL), but still here are examples:
0.14812561761131
0.057436987123556
Answer the question
In order to leave comments, you need to log in
0.14812561761131
0.057436987123556
I agree with the previous answer. The length may simply depend on rounding. What do you want to end up with? It is impossible to understand which generator is based on two samples. You can't even guess the distribution here.
There is only one available in Javascript - Math.random() , everything else random and pseudo-random in Javascript still revolves around it.
If you need a random number of a certain length, it's easier to create it artificially.
Random number with 3 decimal places:
or like this:Math.random().toString().slice(0, 2 + 3 )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question