jeudi 30 août 2018

How to generate random numbers between 0.1 and 0.01

I know its possible to generate integer random number using

(rand() % (difference_between_upper_and_lower_limit)) + lower_limit

I'm wondering if theres a way to generate a number between 0.1 and 0.01. I've tried double speed = (rand() % 10)/100; But it always just gives me 0.0000000; Thanks in Advance!`




Aucun commentaire:

Enregistrer un commentaire