| 1639 | } |
| 1640 | |
| 1641 | static 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 | |
| 1666 | static void ntWriteShort(number a, const coeffs cf) |
| 1667 | { |
nothing calls this directly
no test coverage detected