operator<<

Function


friend ostream& operator << ( ostream& os, const BigInteger& val );

Get the value of the BigInteger object to the output stream.

Parameters

An ostream object and a BigInteger object.

Return value

The ostream object.

Example

#include <iostream> 
#include <string>
#include "HKUAL_BigInteger.h"
using namespace std;
using namespace HKUAL;

int main() {
    BigInteger bigInt( "-10000" );
    cout << "bigInt = " << bigInt << endl;
    return( 0 );
}

Output

bigInt = -10000

Time Complexity

, n is number of digits of the big integer.

© The University of Hong Kong Algorithms Library - hkual@cs.hku.hk