Macaulay2 Engine
Loading...
Searching...
No Matches
◆
elem_text_out()
void M2::ARingZZ::elem_text_out
(
buffer
&
o
,
const
ElementType
&
a
,
bool
p_one
=
true
,
bool
p_plus
=
false
,
bool
p_parens
=
false
) const
Definition at line
35
of file
aring-zz-flint.cpp
.
40
{
41
char
* str;
42
43
(void) p_parens;
44
bool
is_neg = (fmpz_cmp_si(&a, 0) == -1);
45
bool
is_one = (fmpz_cmp_si(&a, 1) == 0 || fmpz_cmp_si(&a, -1) == 0);
46
47
if
(!is_neg && p_plus) o <<
'+'
;
48
if
(is_one)
49
{
50
if
(is_neg) o <<
'-'
;
51
if
(p_one) o <<
'1'
;
52
}
53
else
54
{
55
str = fmpz_get_str(
static_cast<
char
*
>
(
nullptr
), 10, &a);
56
o << str;
57
}
58
}
M2
ARingZZ
Generated on
for Macaulay2 Engine by
1.15.0