|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH] block/iscsi: handle BUSY condition |
Date: | Thu, 29 May 2014 21:17:48 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Il 29/05/2014 20:41, Peter Lieven ha scritto:
static inline unsigned geo_rand_range(double m, double n) { return exp((log(m) + (double)rand() / (RAND_MAX / (log(n) - log(m) + log(1)) + log(1)))); }
Yes, exactly (except that log(1) is zero, and was only needed in your case because you were using integers).
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |