changeset 366:bbc93e52dd5c

Fixes to picked, tests now pass
author Chris Cannam
date Fri, 12 Jul 2013 17:00:21 +0100
parents de59b3504455
children 9afd71c8aff5
files may/stream/filter.yeti
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/may/stream/filter.yeti	Fri Jul 12 10:38:42 2013 +0100
+++ b/may/stream/filter.yeti	Fri Jul 12 17:00:21 2013 +0100
@@ -482,12 +482,15 @@
 picked frac s =
     s with
     {
-        get position () = int (s.position / frac),
+        get position () = int Math#ceil(s.position / frac),
         get available () =
-            case s.available of Known n: Known (int (n/frac)); other: other esac,
+            case s.available of 
+            Known n: Known (int Math#ceil(n / frac)); 
+            other: other 
+            esac,
         read n =
            (m = s.read (n*frac);
-            obtained = int ((mat.width m) / frac);
+            obtained = int Math#ceil((mat.width m) / frac);
             mat.flipped
                (mat.newMatrix (ColumnMajor ())
                    (map do c: mat.getColumn (c*frac) m done [0..obtained-1])))