| 1664 | } |
| 1665 | |
| 1666 | static 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 | |
| 1691 | static const char * ntRead(const char *s, number *a, const coeffs cf) |
| 1692 | { |
nothing calls this directly
no test coverage detected