MCPcopy Create free account
hub / github.com/Singular/Singular / ntWriteLong

Function ntWriteLong

libpolys/polys/ext_fields/transext.cc:1641–1664  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1639}
1640
1641static void ntWriteLong(number a, const coeffs cf)
1642{
1643 ntTest(a);
1644 if (IS0(a))
1645 StringAppendS("0");
1646 else
1647 {
1648 fraction f = (fraction)a;
1649 // stole logic from napWrite from kernel/longtrans.cc of legacy singular
1650 BOOLEAN omitBrackets = p_IsConstant(NUM(f), ntRing);
1651 if (!omitBrackets) StringAppendS("(");
1652 p_String0Long(NUM(f), ntRing, ntRing);
1653 if (!omitBrackets) StringAppendS(")");
1654 if (!DENIS1(f))
1655 {
1656 StringAppendS("/");
1657 omitBrackets = p_IsConstant(DEN(f), ntRing);
1658 if (!omitBrackets) StringAppendS("(");
1659 p_String0Long(DEN(f), ntRing, ntRing);
1660 if (!omitBrackets) StringAppendS(")");
1661 }
1662 }
1663 ntTest(a); // !!!!
1664}
1665
1666static void ntWriteShort(number a, const coeffs cf)
1667{

Callers

nothing calls this directly

Calls 3

StringAppendSFunction · 0.85
p_IsConstantFunction · 0.85
p_String0LongFunction · 0.85

Tested by

no test coverage detected