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

Function ntWriteShort

libpolys/polys/ext_fields/transext.cc:1666–1689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1664}
1665
1666static void ntWriteShort(number a, const coeffs cf)
1667{
1668 ntTest(a);
1669 if (IS0(a))
1670 StringAppendS("0");
1671 else
1672 {
1673 fraction f = (fraction)a;
1674 // stole logic from napWrite from kernel/longtrans.cc of legacy singular
1675 BOOLEAN omitBrackets = p_IsConstant(NUM(f), ntRing);
1676 if (!omitBrackets) StringAppendS("(");
1677 p_String0Short(NUM(f), ntRing, ntRing);
1678 if (!omitBrackets) StringAppendS(")");
1679 if (!DENIS1(f))
1680 {
1681 StringAppendS("/");
1682 omitBrackets = p_IsConstant(DEN(f), ntRing);
1683 if (!omitBrackets) StringAppendS("(");
1684 p_String0Short(DEN(f), ntRing, ntRing);
1685 if (!omitBrackets) StringAppendS(")");
1686 }
1687 }
1688 ntTest(a);
1689}
1690
1691static const char * ntRead(const char *s, number *a, const coeffs cf)
1692{

Callers

nothing calls this directly

Calls 3

StringAppendSFunction · 0.85
p_IsConstantFunction · 0.85
p_String0ShortFunction · 0.85

Tested by

no test coverage detected