diff options
author | Peter Wemm <peter@FreeBSD.org> | 1997-08-29 06:14:05 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1997-08-29 06:14:05 +0000 |
commit | 3be5a5220c034f437450887d67b94b2c64a7bea4 (patch) | |
tree | b45bf79534617c2061d38a694083f7fa0498ac40 /contrib/libgmp/mpbsd/min.c | |
parent | 2eba9bcd51e79547c906b20cf63033f7c2bf1aac (diff) | |
download | src-3be5a5220c034f437450887d67b94b2c64a7bea4.tar.gz src-3be5a5220c034f437450887d67b94b2c64a7bea4.zip |
Notes
Diffstat (limited to 'contrib/libgmp/mpbsd/min.c')
-rw-r--r-- | contrib/libgmp/mpbsd/min.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/libgmp/mpbsd/min.c b/contrib/libgmp/mpbsd/min.c index 6edb1716628a..7ffad6c7e5fe 100644 --- a/contrib/libgmp/mpbsd/min.c +++ b/contrib/libgmp/mpbsd/min.c @@ -26,6 +26,27 @@ MA 02111-1307, USA. */ #include "gmp.h" #include "gmp-impl.h" +static int +digit_value_in_base (c, base) + int c; + int base; +{ + int digit; + + if (isdigit (c)) + digit = c - '0'; + else if (islower (c)) + digit = c - 'a' + 10; + else if (isupper (c)) + digit = c - 'A' + 10; + else + return -1; + + if (digit < base) + return digit; + return -1; +} + void #if __STDC__ min (MINT *dest) |