Skip to content

Conversation

@lucioleKi
Copy link
Contributor

Add guard BIF erlang:is_integer/3, following the design of the original EEP-16, only changing the name from is_between to is_integer. This BIF takes in 3 parameters, Term, LowerBound, and UpperBound.
It returns true if Term, LowerBound, and UpperBound are all integers, and LowerBound =< Term =< UpperBound; otherwise, it returns false.

Failure: badarg if LowerBound or UpperBound does not evaluate to an integer.

Example:

1> is_integer(2, 1, 10).
true
2> is_integer(11, 1, 10).
false
3> is_integer(1, 1.0, 10.0).
** exception error: bad argument
     in function  is_integer/3
        called as is_integer(1,1.0,10.0)

We decide to not update and reuse the previous PR because the name of the BIF has changed.

@lucioleKi lucioleKi self-assigned this Oct 13, 2025
@lucioleKi lucioleKi added the team:VM Assigned to OTP team VM label Oct 13, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 13, 2025

CT Test Results

     7 files     635 suites   3h 17m 4s ⏱️
 6 277 tests  5 836 ✅ 440 💤 1 ❌
12 564 runs  12 037 ✅ 526 💤 1 ❌

For more details on these failures, see this check.

Results for commit 64b2fde.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

@lucioleKi lucioleKi force-pushed the isabell/erts/is-integer-3/OTP-19809 branch from 2fbafae to a211a3a Compare October 22, 2025 14:20
Add guard BIF `erlang:is_integer/3`, following the design of the
original EEP-16, only changing the name from `is_between` to
`is_integer`. This BIF takes in 3 parameters, `Term`, `LowerBound`,
and `UpperBound`.
It returns `true` if `Term`, `LowerBound`, and `UpperBound` are
all integers, and `LowerBound =< Term =< UpperBound`; otherwise,
it returns false.

Failure: `badarg` if `LowerBound` or `UpperBound` does not evaluate to
an integer.

Example:

````
1> is_integer(2, 1, 10).
true
2> is_integer(11, 1, 10).
false
3> is_integer(1, 1.0, 10.0).
** exception error: bad argument
     in function  is_integer/3
        called as is_integer(1,1.0,10.0)
````

Co-authored-by: Björn Gustavsson <[email protected]>
Co-authored-by: John Högberg <[email protected]>
@lucioleKi lucioleKi force-pushed the isabell/erts/is-integer-3/OTP-19809 branch from 2df10c5 to 64b2fde Compare October 24, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team:VM Assigned to OTP team VM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants