Jump to content
  • 0

RANDOM


DaVIdoSS

Question

Could someone please show me how this work:

_rndnum = round (random 3) + 4;

This returns 1+4=5 , 2+4=6, 3+4=7  ?? 

and that:

_rndnum = floor(random 7);

This returns 1,2,3,4,5,6  ??

 

Is that right?

 

I try to search about my self but idk even how i should call it.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You can find info here: 

 

round => https://community.bistudio.com/wiki/round

floor => https://community.bistudio.com/wiki/floor

 

like in math, the content in the (parenthesis) is taken separately, so the result of Random is generated, and you either do the rounding or the floor in that give n number. 

Your first example of the round(random 3) is correct, the result will be that. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...