+ std::string cmd = "python -c 'print ";
+ if (n.sign == negative)
+ cmd += '-';
+ cmd += "0x" + numberToHex(n) + "'";
+
+ char buf[BUFSIZ];
+ FILE *ptr;
+
+ if ((ptr = popen(cmd.c_str(), "r")) != NULL)
+ while (fgets(buf, BUFSIZ, ptr) != NULL)
+ os << buf;
+ pclose(ptr);
+ return os;
+}
+
+template < typename N, typename E >
+std::string numberToHex(const number< N, E >& n)
+{
+ std::ostringstream os;
+ typename number< N, E >::const_reverse_iterator i = n.chunk.rbegin();
+ typename number< N, E >::const_reverse_iterator end = n.chunk.rend();
+ // Salteo ceros
+ for (; i != end; ++i)
+ if (*i != 0)
+ break;
+ if (i != end) // Si no llegué al final, imprimo sin 'leading zeros'
+ {
+ os << std::hex << *i;
+ ++i; // y voy al próximo
+ }
+ // imprimo el resto con 'leading zeros'
+ for (; i != end; ++i)
+ os << std::setfill('0') << std::setw(sizeof(N) * 2) << std::hex
+ << *i;
+ return os.str();
+}
+
+template < typename N, typename E >
+std::string numberToHexDebug(const number< N, E >& n)
+{
+ std::ostringstream os;