-
- std::cout << "=====\nTest code" << std::endl;
-
- /*
- * If you want to experiment with the library,
- * put your own test code here.
- */
-
- /*
- * (End of test code)
- */
-
- // Let's do some heavy lifting.
- std::cout << "=====\nPowers of 3" << std::endl;
- std::cout << "How many do you want?" << std::endl;
- int maxPower;
- std::cin >> maxPower;
-
- BigUnsigned x(1), three(3);
+
+ BigUnsigned i(0xFF0000FF), j(0x0000FFFF);
+ // All five ``return-by-value'' bitwise operators.
+ std::cout.flags(std::ios::hex | std::ios::showbase);
+ std::cout << (i & j) << '\n' << (i | j) << '\n' << (i ^ j) << '\n'
+ << (j << 21) << '\n' << (j >> 10) << '\n';
+ std::cout.flags(std::ios::dec);
+
+ // Let's do some heavy lifting and calculate powers of 314.
+ int maxPower = 10;
+ BigUnsigned x(1), big314(314);