commit 74ca29ea90c0f4c97bffc6f07eca74f1224ddb9c parent 6bb4b8a6345b1e78793c5e608fec31e90dcc4793 Author: Ed van Bruggen <edvb@uw.edu> Date: Mon, 2 Sep 2019 02:29:25 -0700 Add truncate rounding function Diffstat:
tibs/lib.tsp | | | 1 | + |
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/tibs/lib.tsp b/tibs/lib.tsp @@ -126,6 +126,7 @@ (define tau (* 2 pi)) (define e (exp 1.)) +(define (truncate x) (* (floor (abs x)) (sgn x))) (define (sqr x) (* x x)) (define (root b p) (^ b (/ 1 p))) (define (sqrt x) (root x 2))