diff scripts/signal/bartlett.m @ 13279:984359717d71

Use common code idiom for checking whether a double value is an integer. * num2str.m, rotdim.m, get_first_help_sentence.m, ind2rgb.m, commutation_matrix.m, figure.m, legend.m, polyfit.m, bartlett.m, blackman.m, detrend.m, hamming.m, hanning.m, factorial.m, mode.m, skewness.m, statistics.m, mcnemar_test.m: Use idiom 'x == fix (x)' to test for integerness.
author Rik <octave@nomad.inbox5.com>
date Wed, 05 Oct 2011 13:10:10 -0700
parents b3a8b75dfec3
children 72c96de7a403
line wrap: on
line diff
--- a/scripts/signal/bartlett.m	Wed Oct 05 12:00:31 2011 -0700
+++ b/scripts/signal/bartlett.m	Wed Oct 05 13:10:10 2011 -0700
@@ -34,7 +34,7 @@
     print_usage ();
   endif
 
-  if (! (isscalar (m) && (m == round (m)) && (m > 0)))
+  if (! (isscalar (m) && (m == fix (m)) && (m > 0)))
     error ("bartlett: M has to be an integer > 0");
   endif
 
@@ -60,4 +60,4 @@
 %!error bartlett ();
 %!error bartlett (0.5);
 %!error bartlett (-1);
-%!error bartlett (ones(1,4));
\ No newline at end of file
+%!error bartlett (ones(1,4));