]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gas/bignum.h
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / gas / bignum.h
CommitLineData
fecd2382 1/* bignum.h-arbitrary precision integers
3340f7e5 2 Copyright (C) 1987, 1992 Free Software Foundation, Inc.
6efd877d 3
a39116f1 4 This file is part of GAS, the GNU Assembler.
6efd877d 5
a39116f1
RP
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
6efd877d 10
a39116f1
RP
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
6efd877d 15
a39116f1
RP
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
fecd2382
RP
19
20/***********************************************************************\
a39116f1
RP
21 * *
22 * Arbitrary-precision integer arithmetic. *
23 * For speed, we work in groups of bits, even though this *
24 * complicates algorithms. *
25 * Each group of bits is called a 'littlenum'. *
26 * A bunch of littlenums representing a (possibly large) *
27 * integer is called a 'bignum'. *
28 * Bignums are >= 0. *
29 * *
30 \***********************************************************************/
fecd2382
RP
31
32#define LITTLENUM_NUMBER_OF_BITS (16)
33#define LITTLENUM_RADIX (1 << LITTLENUM_NUMBER_OF_BITS)
34#define LITTLENUM_MASK (0xFFFF)
35#define LITTLENUM_SHIFT (1)
36#define CHARS_PER_LITTLENUM (1 << LITTLENUM_SHIFT)
37#ifndef BITS_PER_CHAR
38#define BITS_PER_CHAR (8)
39#endif
40
41typedef unsigned short LITTLENUM_TYPE;
42
43/* JF truncated this to get around a problem with GCC */
3340f7e5 44#define LOG_TO_BASE_2_OF_10 (3.3219280948873623478703194294893901758651)
a39116f1 45/* WARNING: I haven't checked that the trailing digits are correct! */
fecd2382 46
6efd877d
KR
47/* lengths are in sizeof(littlenum)s */
48#if __STDC__ == 1
49
50int bignum_copy (LITTLENUM_TYPE * in, int in_length,
51 LITTLENUM_TYPE * out, int out_length);
52
53#else
54
55int bignum_copy ();
56
57#endif /* __STDC__ */
58
59
a39116f1 60/* end of bignum.h */