From 9ef1cc2424e5afa21d3980b56046f5fb71bff89f Mon Sep 17 00:00:00 2001 From: _ov4 Date: Thu, 22 Oct 2026 15:20:26 +0000 Subject: feat(output)!: print REAL values in shortest round-trip form OUTPUT and NUM_TO_STR now share Python repr formatting instead of %f. BREAKING CHANGE: REAL output changes from six fixed decimals (2.500000) to the shortest round-trip text (2.5). Co-Authored-By: Claude Sonnet 5.5 --- doc/language/function/cpsc-function-num_to_str.7.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/language/function/cpsc-function-num_to_str.7.md') diff --git a/doc/language/function/cpsc-function-num_to_str.7.md b/doc/language/function/cpsc-function-num_to_str.7.md index 39b6890..8e895ee 100644 --- a/doc/language/function/cpsc-function-num_to_str.7.md +++ b/doc/language/function/cpsc-function-num_to_str.7.md @@ -14,7 +14,7 @@ NUM_TO_STR(number : INTEGER or REAL) RETURNS STRING Provided by the standard string library, loaded and linked by default. -Format INTEGER as signed decimal text and REAL with six digits after the decimal point. +Format INTEGER as signed decimal text and REAL in the same shortest round-trip form that OUTPUT prints. The text is the shortest decimal text that reads back as the same value (as Python's `repr`): fixed notation with at least one fractional digit when 1e-4 <= |x| < 1e16 (`2.0`, `87.5`, `0.0001`), otherwise scientific notation with an exponent of at least two digits (`1e-07`, `1.5e-07`, `1e+16`); special values print as `-0.0`, `inf`, `-inf` and `nan`. # EXAMPLE -- cgit v1.3.1-4-g156e