comparison scripts/linear-algebra/duplication_matrix.m @ 13286:49ae6f497171

Use common code idiom x == fix (x) to detect integers * cosd.m, sind.m, tand.m, duplication_matrix.m: Use common code idiom x == fix (x) to detect integers.
author Rik <octave@nomad.inbox5.com>
date Fri, 07 Oct 2011 08:28:00 -0700
parents 0fe1b5d4db56
children 72c96de7a403
comparison
equal deleted inserted replaced
13285:cb9b60b1c9bb 13286:49ae6f497171
66 66
67 if (nargin != 1) 67 if (nargin != 1)
68 print_usage (); 68 print_usage ();
69 endif 69 endif
70 70
71 if (! (isscalar (n) && n == round (n) && n > 0)) 71 if (! (isscalar (n) && n > 0 && n == fix (n)))
72 error ("duplication_matrix: N must be a positive integer"); 72 error ("duplication_matrix: N must be a positive integer");
73 endif 73 endif
74 74
75 d = zeros (n * n, n * (n + 1) / 2); 75 d = zeros (n * n, n * (n + 1) / 2);
76 76