| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- //
- // bignumber_test_printers.cpp
- // bigdecimal
- //
- // Created by Sam Jaffe on 5/20/18.
- //
- #include "bignumber_test_printers.h"
- #include <iostream>
- void math::PrintTo(math::bigdecimal const & dec, std::ostream * out) {
- (*out) << dec.to_string() << "(" << dec.scale() << ")";
- }
- void math::PrintTo(math::biginteger const & dec, std::ostream * out) {
- (*out) << dec.to_string();
- }
- void PrintTo(BigDecPair const & tup, std::ostream * out) {
- (*out) << "{ lhs = ";
- math::PrintTo(tup.lhs, out);
- (*out) << ", rhs = ";
- math::PrintTo(tup.rhs, out);
- (*out) << " }";
- }
- void std::PrintTo(BigIntPair const & tup, std::ostream * out) {
- (*out) << "{ lhs = ";
- math::PrintTo(std::get<0>(tup), out);
- (*out) << ", rhs = ";
- math::PrintTo(std::get<1>(tup), out);
- (*out) << " }";
- }
- void PrintTo(ArithTuple const & tup, std::ostream * out) {
- (*out) << "{ lhs = ";
- math::PrintTo(tup.lhs, out);
- (*out) << ", rhs = ";
- math::PrintTo(tup.rhs, out);
- (*out) << " } -> " << tup.expected;
- }
|