diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-22 15:20:26 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-22 15:20:26 +0000 |
| commit | 9ef1cc2424e5afa21d3980b56046f5fb71bff89f (patch) | |
| tree | 7b1fff9f3114601e3fa7a29ecc9e31481a4bccf6 /doc/language/function | |
| parent | 5c491c54a22044ef1570c3fb709e14264e367fb1 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'doc/language/function')
| -rw-r--r-- | doc/language/function/cpsc-function-num_to_str.7.md | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
