From 98630e6e5f233df5d628e57ca4cb5a315cffc9b2 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Tue, 4 Oct 2005 05:37:51 +0000 Subject: [PATCH] Agrega signo a la salida del operator<< para un ostream. --- src/number.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/number.h b/src/number.h index e7e9c7b..43ed0b9 100644 --- a/src/number.h +++ b/src/number.h @@ -297,8 +297,12 @@ template < typename N, typename E > std::ostream& operator<< (std::ostream& os, const number< N, E >& n) { // FIXME sacar una salida bonita en ASCII =) - for (typename number< N, E >::const_iterator i = n.chunk.begin(); - i != n.chunk.end(); ++i) + if (n.sign == positive) + os << "+ "; + else + os << "- "; + for (typename number< N, E >::const_reverse_iterator i = n.chunk.rbegin(); + i != n.chunk.rend(); ++i) os << std::setfill('0') << std::setw(sizeof(N) * 2) << std::hex << *i << " "; return os; -- 2.43.0