]> git.llucax.com Git - z.facultad/75.29/dale.git/blobdiff - tests/number.cpp
Simplifica salida de operator<< para ostream.
[z.facultad/75.29/dale.git] / tests / number.cpp
index bee99760e0070cc51efbdf8b28568e4435ffd3e9..490767ef39c5d69463917bdbb4d18b9ec84aa209 100644 (file)
@@ -3,14 +3,44 @@
 
 int main()
 {
-       //unsigned buf[5] = { 0xfffffffe, 0xffffffff, 0xffffffff, 0xffffffff, 0 };
+#if 0
+       unsigned buf[5] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0 };
        //unsigned buf[3] = { 0xffffffff, 0x1, 0 };
-       number< unsigned > nu = 0xffffffff;
+       number<> nu(buf, 4);
        //number< unsigned > nu2(nu);
-       number< unsigned > 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
+       number< unsigned > nu = 0xffffffff;
+       std::cout << "nu = " << nu << "\n\n";
+
+       nu << 5;
+       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;
+
 }