Generate pseudo-random numbers

Asked

Viewed 66 times

1

Featuring a pseudo-random number generator that generates a sequence of numbers X1, x2, ... in the range [0,1]. How to turn these numbers into Y1, Y2 numbers... in the range [-11, 17]?

  • 1

    Welcome to Stackoverflow Joab. Please post an excerpt of the code you already have to get a better idea of the problem, I suggest you read this help article from the site: How to create a Minimal, Complete and Verifiable example [(https://answall.com/help/mcve).

  • Multiply the number obtained by 28 and subtract 11. Say your routine returns 0.1, then ( 0.1 * 28 ) - 11 = -8.2. Results will range from -11 to 17 as requested.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.