Old snapshot `BigIntegerLibrary-2004.12.24.2'; see the ChangeLog file.
[bigint/bigint.git] / BigIntegerUtils.hh
CommitLineData
05780f4b
MM
1/*
2* Matt McCutchen's Big Integer Library
3* http://mysite.verizon.net/mccutchen/bigint/
4*/
5
6#ifndef BIGINTEGERUTILS
7#define BIGINTEGERUTILS
8
9#include "BigInteger.hh"
10#include <string>
11#include <iostream>
12
13/*
14* This file includes:
15* (1) `std::string <=> BigUnsigned/BigInteger' conversion routines easier than `BigUnsignedInABase'
16* (2) << and >> operators for BigUnsigned/BigInteger, std::istream/std::ostream
17*/
18
19// Conversion routines. Base 10 only.
20std::string easyBUtoString(const BigUnsigned &x);
21std::string easyBItoString(const BigInteger &x);
22BigUnsigned easyStringToBU(const std::string &s);
23BigInteger easyStringToBI(const std::string &s);
24
25// Outputs x to os, obeying the flags `dec', `hex', `bin', and `showbase'.
26std::ostream &operator <<(std::ostream &os, const BigUnsigned &x);
27
28// Outputs x to os, obeying the flags `dec', `hex', `bin', and `showbase'.
29// My somewhat arbitrary policy: a negative sign comes before a base indicator (like -0xFF).
30std::ostream &operator <<(std::ostream &os, const BigInteger &x);
31
32#endif