$NetBSD: patch-aa,v 1.2 2005/10/23 20:10:57 rillig Exp $ --- measure.c.old Tue Jan 11 22:12:21 2005 +++ measure.c Wed Feb 2 12:17:54 2005 @@ -39,7 +39,7 @@ double quantum_frand() { - return (double) rand() / RAND_MAX; + return (double) random() / RAND_MAX; } /* Measure the contents of a quantum register */ @@ -64,7 +64,7 @@ result. Otherwise, continue with the next base state. */ r -= quantum_prob_inline(reg.node[i].amplitude); - if(quantum_prob_inline(reg.node[i].amplitude) >= r) + if(0 >= r) return reg.node[i].state; }