Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Ensure that I don't 'fix' it by accident in the future
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 6 Feb 2020 13:33:00 +0000 (14:33 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 6 Feb 2020 13:33:00 +0000 (14:33 +0100)
teshsuite/simdag/evaluate-get-route-time/evaluate-get-route-time.c

index ff86f3a..6ce4fd9 100644 (file)
@@ -32,7 +32,7 @@ int main(int argc, char **argv)
   xbt_assert(host_count > 1);
   i = rand() % host_count;
   j = rand() % (host_count - 1);
-  if (j >= i)
+  if (j >= i) // '>=' is not a bug: j is uniform on host_count-1 values, and shifted on need to maintain uniform random
     j++;
 
   const_sg_host_t h1 = hosts[i];