$$F : \Bbb R \times \Bbb R \rightarrow \Bbb N $$ $$F(\text{minReal},\ \text{maxReal}) = \text{randomInt} \in \left[\text{minReal},\ \text{maxReal}\right] $$
Let $r \in [0, 1)$ be a random value. How can I define the above function F?
Note that a simple expression like: $$F(\text{minReal},\ \text{maxReal}) = \operatorname{round}(r (\text{maxReal} - \text{minReal}) + \text{minReal})$$ doesn't work because it may return an integer $\notin \left[\text{minReal},\ \text{maxReal}\right]$.
If exists an integer number between minFloat and maxFloat this should work:
let min = ceil(minFloat)
let max = floor(maxFloat)
F(minFloat, maxFloat) = floor(r * (max - min + 1) + min)