First of all this post is factually "dead" for two month so please do not revive the zombies unless it is necessary and if you do provide some more context as rereading the 17 posts of an answered question isn't that much fun, thank you.

As far as I recall it the question was:

Or in code why:

`Math.floor(Math.random()*5)+1`

and not

`Math.floor(Math.random()*5+1)`

And my answer was, illustrated by examples, that in the end they yield the same result because flooring an integer value isn't doing that much. This had nothing to do with operator precedence whatsoever but with a basic understanding of math. And quite frankly I don't see where this should be wrong, so could you elaborate on your point?

And what do your links have to do with the problem?

If you take the last of them which is probably the most useful one:

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Operator_Precedence

You can see that javaScript intuitively applies PEMDAS (minus the E because an exponential operator is not implemented yet) and as said how is this contradicting what I stated? And what should the other two links tell me? How PEMDAS works? And even if this was the case, the important question there would be how does javaScript handle it and not how math does. Because for example the "=" operator is quite different from it's use in math.

PS: In the end it comes down to solving this task:

Generate random integer numbers in a certain interval while having:

- basic math +-*/

- a function generating random floating point numbers from 0 to 1 (excluded actual 1)

- a function that rounds down to the next integer

go ahead and mix these to fulfill the task of generating a random integer number in the range from x to y. And I'd assume that it is less about a "best way" to do this but more about getting to know basic functions by applying them to a simple problem.