Andreas Köhler <[EMAIL PROTECTED]> writes:

> @@ -632,6 +635,9 @@
>               gint64 nb = rand();
>               gint64 ne;
>  
> +             /* avoid 0 */
> +             if (nb == 0) { i--; continue; }
> +
>               /* avoid overflow; */
>               na /= 2;
>               nb /= 2;

You should probably put this test after the divide-by-2, because
if rand() returns 1 for nb then the nb /= 2 -> 1/2 -> 0.

-derek
-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [EMAIL PROTECTED]                        PGP key available

_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to