Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
11093:d748acc75658 | 11094:add5beb3b845 |
---|---|
65 print_usage (); | 65 print_usage (); |
66 endif | 66 endif |
67 | 67 |
68 | 68 |
69 if (isscalar (p)) | 69 if (isscalar (p)) |
70 if (!(p >= 0) || !(p <= 1)) | 70 if (p < 0 || p > 1) |
71 rnd = NaN (sz); | 71 rnd = NaN (sz); |
72 elseif (p == 0) | 72 elseif (p == 0) |
73 rnd = Inf (sz); | 73 rnd = Inf (sz); |
74 elseif ((p > 0) & (p < 1)); | 74 elseif (p > 0 && p < 1); |
75 rnd = floor (- rande(sz) ./ log (1 - p)); | 75 rnd = floor (- rande(sz) ./ log (1 - p)); |
76 else | 76 else |
77 rnd = zeros (sz); | 77 rnd = zeros (sz); |
78 endif | 78 endif |
79 else | 79 else |