From c963c3b32b925c622ce0126beed3e672961845b7 Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Wed, 5 Oct 2005 05:27:43 +0000 Subject: [PATCH] El signo no necesita ser mutable. --- src/number.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/number.h b/src/number.h index 27d19a8..8fd7efc 100644 --- a/src/number.h +++ b/src/number.h @@ -105,7 +105,7 @@ struct number // Atributos //private: - chunk_type chunk; + mutable chunk_type chunk; sign_type sign; // Helpers @@ -410,8 +410,9 @@ std::ostream& operator<< (std::ostream& os, const number< NN, EE >& n) os << "+ "; else os << "- "; - for (typename number< NN, EE >::const_reverse_iterator i = n.chunk.rbegin(); - i != n.chunk.rend(); ++i) + typename number< NN, EE >::const_reverse_iterator i = n.chunk.rbegin(); + typename number< NN, EE >::const_reverse_iterator end = n.chunk.rend(); + for (; i != end; ++i) os << std::setfill('0') << std::setw(sizeof(NN) * 2) << std::hex << *i << " "; return os; @@ -519,7 +520,7 @@ std::pair< number< N, E >, number< N, E > > number< N, E >::split() const template < typename N, typename E > -void normalize_length(number< N, E >& u, number< N, E >& v) +void normalize_length(const number< N, E >& u, const number< N, E >& v) { typedef number< N, E > num_type; typename num_type::size_type max, p, t, pot2; @@ -554,6 +555,7 @@ void normalize_length(number< N, E >& u, number< N, E >& v) template < typename N, typename E > number < N, E > naif(const number< N, E > &u, const number< N, E > &v) { + normalize_length(u, v); typedef number< N, E > num_type; // tomo el chunk size de u (el de v DEBE ser el mismo) -- 2.43.0