]> git.llucax.com Git - z.facultad/75.29/dale.git/commitdiff
Agrega signo a la salida del operator<< para un ostream.
authorLeandro Lucarella <luca@llucax.hn.org>
Tue, 4 Oct 2005 05:37:51 +0000 (05:37 +0000)
committerLeandro Lucarella <luca@llucax.hn.org>
Tue, 4 Oct 2005 05:37:51 +0000 (05:37 +0000)
src/number.h

index e7e9c7b33bcfdff52533f365f25a2c6568689c72..43ed0b9f28fdaa2a1d8ec037e30e1fc2dc1670b5 100644 (file)
@@ -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;