comparison scripts/statistics/distributions/hygeinv.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 3306cfcb856e
children 1740012184f9
comparison
equal deleted inserted replaced
11093:d748acc75658 11094:add5beb3b845
37 37
38 if (!isscalar (t) || !isscalar (m) || !isscalar (n)) 38 if (!isscalar (t) || !isscalar (m) || !isscalar (n))
39 error ("hygeinv: t, m and n must all be positive integers"); 39 error ("hygeinv: t, m and n must all be positive integers");
40 endif 40 endif
41 41
42 if ((t < 0) | (m < 0) | (n <= 0) | (t != round (t)) | 42 if (t < 0 || m < 0 || n <= 0 || t != round (t) || m != round (m)
43 (m != round (m)) | (n != round (n)) | (m > t) | (n > t)) 43 || n != round (n) || m > t || n > t)
44 inv = NaN (size (x)) 44 inv = NaN (size (x))
45 else 45 else
46 inv = discrete_inv (x, 0 : n, hygepdf (0 : n, t, m, n)); 46 inv = discrete_inv (x, 0 : n, hygepdf (0 : n, t, m, n));
47 endif 47 endif
48 48