Skip to content

estdlib: add string:to_integer/1#2368

Open
pguyot wants to merge 1 commit into
atomvm:release-0.7from
pguyot:w29/string-to-integer
Open

estdlib: add string:to_integer/1#2368
pguyot wants to merge 1 commit into
atomvm:release-0.7from
pguyot:w29/string-to-integer

Conversation

@pguyot

@pguyot pguyot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Parse a leading (optionally signed) integer from a string, returning {Int, Rest} or {error, no_integer}, matching the OTP string:to_integer/1 semantics. Add a test_to_integer/0 case in test_string.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Parse a leading (optionally signed) integer from a string, returning
{Int, Rest} or {error, no_integer}, matching the OTP string:to_integer/1
semantics. Add a test_to_integer/0 case in test_string.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@petermm

petermm commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

AMP found so many OTP behavior discrepancies/gaps that I asked it to implement one with better parity:
https://github.com/petermm/AtomVM/tree/fix/string-to-integer-chardata

of course more code, your call..

btw notice how test_string seems to be missing from tests/libs/estdlib/tests.erl

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