From: Leandro Lucarella Date: Tue, 4 Oct 2005 02:11:54 +0000 (+0000) Subject: Usa naif() como operator*. X-Git-Tag: Entrega_1~47 X-Git-Url: https://git.llucax.com/z.facultad/75.29/dale.git/commitdiff_plain/c02e4d4bbe2b36ebaa841cea31ed3b67b165529d?ds=inline Usa naif() como operator*. --- diff --git a/src/number.h b/src/number.h index 5b0b71e..57fb1b8 100644 --- a/src/number.h +++ b/src/number.h @@ -229,19 +229,17 @@ std::ostream& operator<< (std::ostream& os, const number< N, E >& n) template < typename N, typename E > number< N, E >& number< N, E >::operator*= (const number< N, E >& n) { - number < N, E > r_op = n; - normalize_length(n); - n.normalize_length(*this); - *this = divide_n_conquer(*this, n); + //number < N, E > r_op = n; + //normalize_length(n); + //n.normalize_length(*this); + *this = naif(*this, n); return *this; } template < typename N, typename E > number< N, E > operator* (const number< N, E >& n1, const number< N, E >& n2) { - number< N, E > tmp = n1; - tmp *= n2; - return tmp; + return naif(n1, n2); } template < typename N, typename E > diff --git a/tests/number.cpp b/tests/number.cpp index 75b97f0..44e56ab 100644 --- a/tests/number.cpp +++ b/tests/number.cpp @@ -8,10 +8,11 @@ int main() //unsigned buf[3] = { 0xffffffff, 0x1, 0 }; number<> nu(buf, 4); //number< unsigned > nu2(nu); - number<> nu2 = 1u; + number<> nu2 = 2u; std::cout << "nu = " << nu << "\n\n"; std::cout << "nu2 = " << nu2 << "\n\n"; std::cout << "nu + nu2 = " << nu + nu2 << "\n\n"; + std::cout << "nu * nu2 = " << nu * nu2 << "\n\n"; #endif #if 0