Mercurial > hg > octave-nkf
comparison scripts/general/bincoeff.m @ 20038:9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Try to trim long lines to < 80 chars.
Use '##' for single line comments.
Use '(...)' around tests for if/elseif/switch/while.
Abut cell indexing operator '{' next to variable.
Abut array indexing operator '(' next to variable.
Use space between negation operator '!' and following expression.
Use two newlines between endfunction and start of %!test or %!demo code.
Remove unnecessary parens grouping between short-circuit operators.
Remove stray extra spaces (typos) between variables and assignment operators.
Remove stray extra spaces from ends of lines.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 23 Feb 2015 14:54:39 -0800 |
parents | 4197fc428c7d |
children |
comparison
equal
deleted
inserted
replaced
20037:a1acca0c2216 | 20038:9fc020886ae9 |
---|---|
110 %!assert (bincoeff (50, 6), 15890700) | 110 %!assert (bincoeff (50, 6), 15890700) |
111 %!assert (bincoeff (0.4, 2), -.12, 8*eps) | 111 %!assert (bincoeff (0.4, 2), -.12, 8*eps) |
112 | 112 |
113 %!assert (bincoeff ([4 NaN 4], [-1, 2, 2.5]), NaN (1, 3)) | 113 %!assert (bincoeff ([4 NaN 4], [-1, 2, 2.5]), NaN (1, 3)) |
114 | 114 |
115 %% Test input validation | 115 ## Test input validation |
116 %!error bincoeff () | 116 %!error bincoeff () |
117 %!error bincoeff (1, 2, 3) | 117 %!error bincoeff (1, 2, 3) |
118 %!error bincoeff (ones (3),ones (2)) | 118 %!error bincoeff (ones (3),ones (2)) |
119 %!error bincoeff (ones (2),ones (3)) | 119 %!error bincoeff (ones (2),ones (3)) |
120 | 120 |