Skip to content

Conversation

sovdeeth
Copy link
Member

Description

Catches long overflows in arithmetic by taking code from Math.addExact and multiplyExact to detect if an overflow occurred.


Target Minecraft Versions: any
Requirements: none
Related Issues: #7209

uses Math.xExact code to catch overflows instead of relying on doubles.
@sovdeeth sovdeeth added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. 2.9 labels Nov 10, 2024
Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
@Moderocky Moderocky added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Nov 17, 2024
@sovdeeth sovdeeth merged commit 91e8b93 into SkriptLang:dev/patch Nov 23, 2024
7 checks passed
Burbulinis pushed a commit to Burbulinis/Skript that referenced this pull request Dec 3, 2024
* catch long overflows

* don't compromise with precision

uses Math.xExact code to catch overflows instead of relying on doubles.

* Apply suggestions from code review

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>

---------

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants