randomize integers

CODAP Forums CODAP Help Forum randomize integers

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #602 Score: 0
    Kristyn Walters
    Participant

    When you are using the random(), is there a way to set it so it randomizes only integers?

    #603
    Bill Finzer
    Keymaster

    Hi Kristyn,

    Here’s a formula that will produce integers from zero to nine:

    floor(random(0,10))

    And if you want them to go from one to ten:

    ceil(random(0,10))

    Of course you can change the zero and ten to anything you want.

    Bill

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.