changeset 11357:903c1a3df301

Add additional tests for mod with non-integer real values.
author Rik <octave@nomad.inbox5.com>
date Mon, 13 Dec 2010 20:39:37 -0800
parents f8cc86b1503e
children f5ee3e6e9266
files src/ChangeLog src/data.cc
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Mon Dec 13 21:59:55 2010 -0500
+++ b/src/ChangeLog	Mon Dec 13 20:39:37 2010 -0800
@@ -1,3 +1,7 @@
+2010-12-13  Rik  <octave@nomad.inbox5.com>
+
+	* data.cc (mod): Additional tests for mod with non-integer real values.
+
 2010-12-12  Jaroslav Hajek  <highegg@gmail.com>
 
 	* DLD-FUNCTIONS/lookup.cc (Flookup): Drop support for the "i" option.
--- a/src/data.cc	Mon Dec 13 21:59:55 2010 -0500
+++ b/src/data.cc	Mon Dec 13 20:39:37 2010 -0800
@@ -772,6 +772,10 @@
 %!assert (mod(uint8(5),4),uint8(1))
 %!assert (mod(5,uint8(4)),uint8(1))
 %!assert (mod(uint8([1:5]),4),uint8([1,2,3,0,1]))
+
+## non-integer real numbers
+%!assert (mod (2.1, 0.1), 0)
+%!assert (mod (2.1, 0.2), 0.1, eps)
 */
 
 // FIXME Need to convert the reduction functions of this file for single precision