summaryrefslogtreecommitdiffstats
path: root/tests/016/arith.tl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/016/arith.tl')
-rw-r--r--tests/016/arith.tl31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/016/arith.tl b/tests/016/arith.tl
index be0d512b..34a82c7f 100644
--- a/tests/016/arith.tl
+++ b/tests/016/arith.tl
@@ -222,3 +222,34 @@
(< '(1 2 3) #(1 2 3.0)) nil
(< '(1 2 3) #(1 2 3 4)) t
(< '(1 2 3) #(1 2 4)) t)
+
+(test
+ (let ((q (quantile 0.5)))
+ [q 0.02 0.5 0.74 3.39 0.83]
+ [mapcar q '(22.37 10.15 15.43 38.62 15.92
+ 34.60 10.28 1.47 0.40 0.05 11.39
+ 0.27 0.42 0.09 11.37)])
+ (0.73999999999999999 0.73999999999999999 2.0616666666666665
+ 4.5517592592592591 4.5517592592592591 9.1519618055555547
+ 9.1519618055555547 9.1519618055555547 9.1519618055555547
+ 6.1797614914021164 6.1797614914021164 6.1797614914021164
+ 6.1797614914021164 4.2462394088036444 4.2462394088036444))
+
+(test
+ (let ((q (quantile 0)))
+ (cons [q] [mapcar q '(1 2 3 4 5)]))
+ (0.0 1.0 1.5 2.0 2.5 3.0))
+
+(test
+ (let ((q (quantile 0 5 0.5)))
+ [mapcar q '(1.0 2.0 3.0 4.0 5.0
+ 0.0 0.0 0.0 0.0 0.0)])
+ (1.0 1.5 2.0 2.5 3.0
+ 1.5 0.75 0.375 0.1875 0.09375))
+
+(test
+ (let ((q (quantile 0 5 0.5)))
+ [mapcar q '(0.0 0.0 0.0 0.0 0.0
+ 3.0 3.0 3.0 3.0 3.0)])
+ (0.0 0.0 0.0 0.0 0.0
+ 1.5 2.25 2.625 2.8125 2.90625))