From 499f04dc4f9f864071d6ff7e75c9cbec60e2fd12 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 16 Oct 2014 19:01:26 -0700 Subject: * arith.c (gcd): Fix semantics. If either operand is zero, return the other operand. (lcm): New function. * eval.c (eval_init): Retarget registration of gcd to variable argument gcdv function. Register lcm. * lib.c (gcdv, lcmv): New functions. * lib.h (gcdv, lcm, lcmv): Declared. * txr.1: Re-document gcd with coverage of lcm. * txr.vim: Regenerated. --- lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib.h') diff --git a/lib.h b/lib.h index cf1a8d4f..fd4763e0 100644 --- a/lib.h +++ b/lib.h @@ -538,6 +538,9 @@ val exptmod(val base, val exp, val mod); val sqroot(val anum); val isqrt(val anum); val gcd(val anum, val bnum); +val gcdv(val nlist); +val lcm(val anum, val bnum); +val lcmv(val nlist); val floorf(val); val ceili(val); val sine(val); -- cgit v1.2.3