[xiph-commits] r17683 - trunk/squishyball

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Nov 29 08:11:42 PST 2010


Author: xiphmont
Date: 2010-11-29 08:11:42 -0800 (Mon, 29 Nov 2010)
New Revision: 17683

Modified:
   trunk/squishyball/main.c
Log:
Oops, expression order matters in rangrange.



Modified: trunk/squishyball/main.c
===================================================================
--- trunk/squishyball/main.c	2010-11-29 15:32:24 UTC (rev 17682)
+++ trunk/squishyball/main.c	2010-11-29 16:11:42 UTC (rev 17683)
@@ -178,7 +178,7 @@
 }
 
 int randrange(int range){
-  return (int)floor(range * rand()/(RAND_MAX+1.0));
+  return (int)floor(rand()/(RAND_MAX+1.0)*range);
 }
 
 void randomize_samples(int *r,int *cchoice, int test_mode){



More information about the commits mailing list