formatReal

Format a double as a PDF real: a sign, digits, an optional dot, and more digits — never an exponent. Rounded to 6 decimal places (ample for coordinates and matrices) with trailing zeros trimmed. NaN/Infinity are not representable in PDF, so they degrade to "0".