]> thyrsus.com Git - cupl.git/commitdiff
Implemented full ABS.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 7 Nov 1994 03:40:52 +0000 (03:40 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 7 Nov 1994 03:40:52 +0000 (03:40 +0000)
monitor.c

index a419008479d10998742a31c9f1c48c12cb858492..e16bbeb2ac420f5f21c120ba10c1a8908c6d39c3 100644 (file)
--- 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);
     }
 }