[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnulib] addition: gcd.h, gcd.c
From: |
Paul Eggert |
Subject: |
Re: [Bug-gnulib] addition: gcd.h, gcd.c |
Date: |
Tue, 5 Nov 2002 15:18:53 -0800 (PST) |
> From: Bruno Haible <address@hidden>
> Date: Tue, 5 Nov 2002 22:53:14 +0100 (CET)
>
> /* 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.
How about if we change the signature of gcd to use uintmax_t instead
of unsigned int? I use GCD on size_t values (see buffer_lcm in
diffutils/lib/cmpbuf.c), and size_t is sometimes wider than unsigned int.