From: Eric S. Raymond Date: Mon, 7 Nov 1994 03:40:52 +0000 (+0000) Subject: Implemented full ABS. X-Git-Tag: 1-2~64 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=c66d2056bc25abaeef188e4709806e9fd30283f4;p=cupl.git Implemented full ABS. --- diff --git a/monitor.c b/monitor.c index a419008..e16bbeb 100644 --- a/monitor.c +++ b/monitor.c @@ -278,8 +278,12 @@ value cupl_abs(value right) die("ABS is only defined for scalar arguments\n"); else { - make_scalar(&result, 0); - result.elements[0] = abs(right.elements[0]); + value result; + int n; + + result = copy_value(right); + for (n = 0; n < right.width * right.depth; n++) + result.elements[n] = fabs(right.elements[n]); return(result); } }