bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] addition: gcd.h, gcd.c


From: Bruno Haible
Subject: [Bug-gnulib] addition: gcd.h, gcd.c
Date: Tue, 5 Nov 2002 22:53:14 +0100 (CET)

Hi,

I've added to the lib this function:

  /* Return the greatest common divisor of a > 0 and b > 0.  */
  extern unsigned int gcd PARAMS ((unsigned int a, unsigned int b));

because I've needed this in gettext in two places:
a. inside some hash table code,
b. when comparing two circular lists of different size.

After all, gcd is the fifth elementary operation after + - * /.

This function operates on small integers; bignums belong into other
packages, like bc, gmp, CLN, NTL etc.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]