Cole-Greer commented on code in PR #3121:
URL: https://github.com/apache/tinkerpop/pull/3121#discussion_r2127322902


##########
docs/src/upgrade/release-3.8.x.asciidoc:
##########
@@ -30,6 +30,26 @@ complete list of all the modifications that are part of this 
release.
 
 === Upgrading for Users
 
+==== Auto promotion of number types
+
+Previously, operations like sum or sack that involved mathematical 
calculations did not automatically promote the result
+to a larger numeric type (e.g., from int to long) when needed. As a result, 
values could wrap around within their current
+type, leading to unexpected behavior. This issue has now been resolved by 
enabling automatic type promotion for results.
+
+Now, any mathematical operations such as Add, Sub, Mul, and Div will now 
automatically promote to the next numeric type
+if an overflow is detected. For integers, the promotion sequence is: byte → 
short → int → long → overflow exception. For
+floating-point numbers, the sequence is: float → double → infinity.
+
+As a example the following query...
+
+"""
+g.withSack(32767s).inject(1s).sack(sum).sack()
+"""
+
+Before would return a short overflow exception or wrap to -1 depending on 
language, but now returns 32769i.
+
+See https://issues.apache.org/jira/browse/TINKERPOP-3115 for more details.

Review Comment:
   Nit: 
   ```suggestion
   See 
link:https://issues.apache.org/jira/browse/TINKERPOP-3115[TINKERPOP-3115] for 
more details.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to