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

Make createIntInRange work for full int range #431

Merged
merged 4 commits into from
Oct 9, 2023

Conversation

vil02
Copy link
Contributor

@vil02 vil02 commented Oct 7, 2023

Purpose

Closes ballerina-platform/ballerina-library#4744

Examples

The code like

random:createIntInRange(int:MIN_VALUE, int:MAX_VALUE);

no longer causes int range overflow error.

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

Other remarks for reviewers

vil02 added 2 commits October 6, 2023 22:18
In order to avoid `int range overflow` error
`startRange` and `endRange` are converted to decimal.
Fixes the issue #4744.
@CLAassistant
Copy link

CLAassistant commented Oct 7, 2023

CLA assistant check
All committers have signed the CLA.

@vil02 vil02 marked this pull request as ready for review October 7, 2023 04:34
@vil02 vil02 requested a review from daneshk as a code owner October 7, 2023 04:34
@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (b820a4b) 100.00% compared to head (636e481) 100.00%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #431   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           22        22           
  Branches        11        11           
=========================================
  Hits            22        22           
Files Coverage Δ
ballerina/natives.bal 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@niveathika
Copy link
Contributor

@vil02 The fix looks good, before we accept the solution could you do the following?

  1. Format the code. (bal format)
  2. Update the changelog with the changes.

Thanks!

vil02 added 2 commits October 9, 2023 08:29
In order to be consistent with the code base,
the files were formatted.
This change is a result of running the command `bal format`.
Information about solving #4744 was addes to the changelog.
@vil02
Copy link
Contributor Author

vil02 commented Oct 9, 2023

Code was formatted in: 80cfe22.
Change long was updated in: 636e481.

@niveathika thanks for the tip with bal format. Please let me know if something is still missing.

@niveathika
Copy link
Contributor

@vil02 Looks good! 👏🏽👏🏽👏🏽

Thanks for the contribution.

@niveathika niveathika merged commit 1bf5835 into ballerina-platform:main Oct 9, 2023
@vil02 vil02 deleted the 4744_int_range_overflow branch October 9, 2023 08:02
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.

int range overflow error when using valid range in random:createIntInRange function
3 participants