[DOCS-14006] Investigate changes in SERVER-50445: Return the value as double when NumberLong subtraction overflows in ExpressionSubtract Created: 20/Nov/20  Updated: 13/Nov/23  Due: 07/May/21  Resolved: 07/May/21

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.9.0, 4.0.22, 3.6.22, 4.2.12, 4.4.3, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Andrew Feierabend (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-50445 Return the value as double when Numbe... Closed
Participants:
Days since reply: 2 years, 39 weeks, 5 days ago
Epic Link: DOCSP-9747
Story Points: 2

 Description   

Description

Downstream Change Summary

Similar to what we have mentioned for $pow, we should update the docs for $sum and $subtract to describe the overflow behaviour.

The result will have the same type as the input except when it cannot be represented accurately in that type. In these cases:

A 32-bit integer will be converted to a 64-bit integer if the result is representable as a 64-bit integer.
A 32-bit integer will be converted to a double if the result is not representable as a 64-bit integer.
A 64-bit integer will be converted to double if the result is not representable as a 64-bit integer.

Description of Linked Ticket

The ExpressionSubtract does subtract operation on two long long data type. This can cause an overflow with large numbers. The right way to do this is to use the DoubleDoubleSummation helper that we use while adding number in ExpressionSum.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Githook User [ 07/May/21 ]

Author:

{'name': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com', 'username': 'andf-mongodb'}

Message: DOCS-14006 clarify return data types sum subtract
Branch: v3.6
https://github.com/mongodb/docs/commit/81784ad1f4d7592e52522f6f5c14de74e4f0da7e

Comment by Githook User [ 07/May/21 ]

Author:

{'name': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com', 'username': 'andf-mongodb'}

Message: DOCS-14006 clarify return data types sum subtract
Branch: v4.0
https://github.com/mongodb/docs/commit/7c4a360de1e527c6e4c7223a2d08d7aa4dce68a9

Comment by Githook User [ 07/May/21 ]

Author:

{'name': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com', 'username': 'andf-mongodb'}

Message: DOCS-14006 clarify return data types sum subtract
Branch: v4.2
https://github.com/mongodb/docs/commit/b944370362ecec980e60987cb0bb06815ce30c37

Comment by Githook User [ 07/May/21 ]

Author:

{'name': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com', 'username': 'andf-mongodb'}

Message: DOCS-14006 clarify return data types sum subtract
Branch: master
https://github.com/mongodb/docs/commit/52b358a855e92cab05aa7551738f9804e390069c

Comment by Githook User [ 07/May/21 ]

Author:

{'name': 'andf-mongodb', 'email': 'andrew.feierabend@mongodb.com', 'username': 'andf-mongodb'}

Message: DOCS-14006 clarify return data types sum subtract
Branch: v5.0
https://github.com/mongodb/docs/commit/774cb4844eed6dcb7cfa955b636bef4d8437e966

Generated at Thu Feb 08 08:09:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.