Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Num.[max/min]SafeInteger #874

Merged
merged 3 commits into from
Apr 8, 2021

Conversation

ChayimFriedman2
Copy link
Contributor

These represent the maximum and the minimum integers that all integers below/above them can be represented accurately (without precision loss), accordingly.

These constants are defined in JS (Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER).

For example, the fmt module by PureFox48 needed maxSafeInteger, and hand-crafted it (https://github.com/NinjasCL-labs/wren-rosetta/blob/832a71ebfa1b817aa06bb9541408f8b6d9a652ef/src/fmt.wren#L18-L19). I thought it would be nice to have that built in.

@ruby0x1 ruby0x1 merged commit 28da4b4 into wren-lang:main Apr 8, 2021
@ChayimFriedman2 ChayimFriedman2 deleted the min-max-safe-integers branch April 8, 2021 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants