X-Git-Url: https://git.llucax.com/z.facultad/75.29/dale.git/blobdiff_plain/99ab093c910f1fdddfb7328f3ea8e9fff484e928..76c86471d3d489f6c63a103f1b7c480f91a3c5ca:/tests/number.cpp diff --git a/tests/number.cpp b/tests/number.cpp index 75b97f0..490767e 100644 --- a/tests/number.cpp +++ b/tests/number.cpp @@ -3,15 +3,16 @@ int main() { -#if 1 +#if 0 unsigned buf[5] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0 }; //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 @@ -22,6 +23,24 @@ int main() std::cout << "nu = " << nu << "\n\n"; #endif + number<> n1 = 0xffff00f0; + number<> n2 = 0xffff00f0; + + n1 += 1; + + n1 <<= 4; + n2 <<= 4; + + if (n1 < n2) + std::cout << "n1 es menor que n2\n"; + else if (n2 < n1) + std::cout << "n1 es mayor que n2\n"; + else + std::cout << "n1 es igual que n2\n"; + + number<> n3 = n1 - n2; + return 0; } +