diff scripts/statistics/distributions/geornd.m @ 11094:add5beb3b845

avoid use of | and & in IF conditions in statistics distribution functions
author John W. Eaton <jwe@octave.org>
date Sat, 09 Oct 2010 11:55:51 -0400
parents be55736a0783
children fe3c3dfc07eb
line wrap: on
line diff
--- a/scripts/statistics/distributions/geornd.m	Sat Oct 09 11:42:22 2010 -0400
+++ b/scripts/statistics/distributions/geornd.m	Sat Oct 09 11:55:51 2010 -0400
@@ -67,11 +67,11 @@
 
 
   if (isscalar (p))
-    if (!(p >= 0) || !(p <= 1))
+    if (p < 0 || p > 1)
       rnd = NaN (sz);
     elseif (p == 0)
       rnd = Inf (sz);
-    elseif ((p > 0) & (p < 1));
+    elseif (p > 0 && p < 1);
       rnd = floor (- rande(sz) ./ log (1 - p));
     else
       rnd = zeros (sz);