Macaulay2 Engine
Loading...
Searching...
No Matches

◆ bignum_text_out()

void bignum_text_out ( buffer & o,
mpz_srcptr a )

Definition at line 12 of file text-io.cpp.

13{
14 char s[1000];
15 char *str;
16
17 int size = static_cast<int>(mpz_sizeinbase(a, 10) + 2);
18 char *allocstr = (size > 1000 ? newarray_atomic(char, size) : s);
19
20 str = mpz_get_str(allocstr, 10, a);
21 o << str;
22
23 if (size > 1000) freemem(allocstr);
24}
void freemem(void *s)
Definition m2-mem.cpp:103
void size_t s
Definition m2-mem.cpp:271
#define newarray_atomic(T, len)
Definition newdelete.hpp:91

References freemem(), newarray_atomic, and s.

Referenced by HermiteComputation::text_out().