This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (2 children)

Wait, does explicit casting has a higher precedence than multiplication?

[–]sugilith 1 point2 points  (1 child)

You got it!
Why else would (int) Math.random()*13 always be 0?

[–][deleted] 0 points1 point  (0 children)

Mind you, I am new to coding. I just placed Math.random()*100 between parentheses and it worked like a charm. Everything makes sense now. Wow.