From 0db5d6dd0637a04f5d603205dd55fa7c279541ea Mon Sep 17 00:00:00 2001 From: Garth Minette Date: Tue, 6 Jul 2021 22:37:51 -0700 Subject: [PATCH] Remove int constraint from quant calls. --- math.scad | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/math.scad b/math.scad index 45755f5..2885de8 100644 --- a/math.scad +++ b/math.scad @@ -330,7 +330,7 @@ function atanh(x) = // o = quant([9,10,10.4,10.5,11,12],3); // Returns: [9,9,9,12,12,12] // p = quant([[9,10,10.4],[10.5,11,12]],3); // Returns: [[9,9,9],[12,12,12]] function quant(x,y) = - assert( is_int(y) && y>0, "The quantum `y` must be a non zero integer.") + assert( is_finite(y) && y>0, "The quantum `y` must be a non zero integer.") is_list(x) ? [for (v=x) quant(v,y)] : assert( is_finite(x), "The input to quantize is not a number nor a list of numbers.") @@ -364,7 +364,7 @@ function quant(x,y) = // o = quantdn([9,10,10.4,10.5,11,12],3); // Returns: [9,9,9,9,9,12] // p = quantdn([[9,10,10.4],[10.5,11,12]],3); // Returns: [[9,9,9],[9,9,12]] function quantdn(x,y) = - assert( is_int(y) && y>0, "The quantum `y` must be a non zero integer.") + assert( is_finite(y) && y>0, "The quantum `y` must be a non zero integer.") is_list(x) ? [for (v=x) quantdn(v,y)] : assert( is_finite(x), "The input to quantize must be a number or a list of numbers.") @@ -398,7 +398,7 @@ function quantdn(x,y) = // p = quantup([9,10,10.4,10.5,11,12],3); // Returns: [9,12,12,12,12,12] // quantup([[9,10,10.4],[10.5,11,12]],3); // Returns: [[9,12,12],[12,12,12]] function quantup(x,y) = - assert( is_int(y) && y>0, "The quantum `y` must be a non zero integer.") + assert( is_finite(y) && y>0, "The quantum `y` must be a non zero integer.") is_list(x) ? [for (v=x) quantup(v,y)] : assert( is_finite(x), "The input to quantize must be a number or a list of numbers.")