Back to index

cell-binutils  2.17cvs20070401
bignum.h
Go to the documentation of this file.
00001 /* bignum.h-arbitrary precision integers
00002    Copyright 1987, 1992, 2003, 2005 Free Software Foundation, Inc.
00003 
00004    This file is part of GAS, the GNU Assembler.
00005 
00006    GAS is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2, or (at your option)
00009    any later version.
00010 
00011    GAS is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with GAS; see the file COPYING.  If not, write to
00018    the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 /***********************************************************************\
00021  *                                                             *
00022  *     Arbitrary-precision integer arithmetic.                        *
00023  *     For speed, we work in groups of bits, even though this         *
00024  *     complicates algorithms.                                        *
00025  *     Each group of bits is called a 'littlenum'.                    *
00026  *     A bunch of littlenums representing a (possibly large)          *
00027  *     integer is called a 'bignum'.                                  *
00028  *     Bignums are >= 0.                                       *
00029  *                                                             *
00030  \***********************************************************************/
00031 
00032 #define       LITTLENUM_NUMBER_OF_BITS    (16)
00033 #define       LITTLENUM_RADIX                    (1 << LITTLENUM_NUMBER_OF_BITS)
00034 #define       LITTLENUM_MASK                     (0xFFFF)
00035 #define LITTLENUM_SHIFT                   (1)
00036 #define CHARS_PER_LITTLENUM        (1 << LITTLENUM_SHIFT)
00037 #ifndef BITS_PER_CHAR
00038 #define BITS_PER_CHAR                     (8)
00039 #endif
00040 
00041 typedef unsigned short LITTLENUM_TYPE;