This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 80b00892b6 Document string-to-number coercion for asNumber() in
Gremlin semantics
80b00892b6 is described below
commit 80b00892b6626bfa11841de2998d033477c650b4
Author: Stephen Mallette <[email protected]>
AuthorDate: Fri Sep 11 12:39:40 2026 +0000
Document string-to-number coercion for asNumber() in Gremlin semantics
Add a Considerations rule describing how asNumber() parses a string with no
type token: integer-valued strings resolve to the smallest of INT, LONG, or
BIGINT that fits, and decimal or exponent-notation strings resolve to FLOAT
(then DOUBLE or BIGDECIMAL). Also remove a duplicated Modulation/Considerations
heading block in the asNumber() section.
Assisted-by: Kiro:claude-opus-4.8
---
docs/src/dev/provider/gremlin-semantics.asciidoc | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/docs/src/dev/provider/gremlin-semantics.asciidoc
b/docs/src/dev/provider/gremlin-semantics.asciidoc
index b99111f064..ae2231692e 100644
--- a/docs/src/dev/provider/gremlin-semantics.asciidoc
+++ b/docs/src/dev/provider/gremlin-semantics.asciidoc
@@ -947,14 +947,10 @@ None
*Considerations:*
-*Modulation:*
-
-None
-
-*Considerations:*
-
If no type token is provided, the incoming number remains unchanged. A `DATE`
input is converted to milliseconds since epoch. A `null` input passes through
as `null`.
+When no type token is provided and the incoming traverser is a `STRING`, the
string is parsed according to its numeric value. A string that represents an
integer value is parsed to the smallest of `INT`, `LONG`, or `BIGINT` that can
represent it. A string containing a decimal point or an exponent is parsed to
`FLOAT` when the value is representable as such, and otherwise to a wider
floating-point type (`DOUBLE`, then `BIGDECIMAL`).
+
*Exceptions:*
* If any overflow occurs during narrowing of types, an `Arithmetic Error` is
raised.