aboutsummaryrefslogtreecommitdiff
path: root/doc/language/function
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-22 15:04:43 +0000
committer_ov4 <ov4@ov4.org>2026-10-22 15:04:43 +0000
commit11266ea732e2533081283290c3c865c234e79b2a (patch)
tree2fbc4104a7fa6edf40f38073821613cf0de9fee4 /doc/language/function
parent463efecf6ddcea31efada01ddd8a7695604ab80f (diff)
fix(stdlib): make IS_NUM agree with STR_TO_NUM and explain conversion errors
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Diffstat (limited to 'doc/language/function')
-rw-r--r--doc/language/function/cpsc-function-is_num.7.md2
-rw-r--r--doc/language/function/cpsc-function-str_to_num.7.md2
2 files changed, 2 insertions, 2 deletions
diff --git a/doc/language/function/cpsc-function-is_num.7.md b/doc/language/function/cpsc-function-is_num.7.md
index efb5f1a..3b9641d 100644
--- a/doc/language/function/cpsc-function-is_num.7.md
+++ b/doc/language/function/cpsc-function-is_num.7.md
@@ -14,7 +14,7 @@ IS_NUM(text : STRING) RETURNS BOOLEAN
Provided by the standard string library, loaded and linked by default.
-Return true for a nonempty string fully consumed by the runtime's numeric conversion. Leading whitespace is accepted; trailing whitespace or other trailing text is rejected.
+Return true exactly when STR_TO_NUM would succeed: a nonempty string fully consumed by `strtod`, with a value inside the REAL range. Leading whitespace, NaN, inf and hexadecimal forms are accepted; trailing whitespace, trailing text, embedded NUL bytes and overflowing values such as `1e999` are rejected. Underflow to zero or a denormal is accepted.
# EXAMPLE
diff --git a/doc/language/function/cpsc-function-str_to_num.7.md b/doc/language/function/cpsc-function-str_to_num.7.md
index acdf60b..48d24db 100644
--- a/doc/language/function/cpsc-function-str_to_num.7.md
+++ b/doc/language/function/cpsc-function-str_to_num.7.md
@@ -14,7 +14,7 @@ STR_TO_NUM(text : STRING) RETURNS REAL
Provided by the standard string library, loaded and linked by default.
-Return REAL, including for integer-looking text. The whole string must be consumed. Invalid text, trailing junk and values outside the REAL range throw a catchable exception. Use IS_NUM first to check numeric text without throwing for invalid input.
+Return REAL, including for integer-looking text. The whole string must be consumed. Invalid text and trailing junk throw a catchable exception reading `STR_TO_NUM: '<text>' is not a number`, and overflowing values throw `STR_TO_NUM: '<text>' is out of the REAL range`. Underflow is accepted. Use IS_NUM first to check numeric text without throwing for invalid input.
# EXAMPLE