Skip to content

BigInt parsing allows whitespace #44570

@Liozou

Description

@Liozou
julia> parse(Int, "100 10")
ERROR: ArgumentError: extra characters after whitespace in "100 10"

julia> parse(BigInt, "100 10")
10010

The second case is the oddity here, and it seems to originate from

err = GC.@preserve bstr MPZ.set_str!(z, pointer(bstr)+(i-firstindex(bstr)), base)

aka MPZ.set_str! does not follow Julia conventions for parsing numbers.

Originally posted by @Liozou in #44550 (comment)

Copy-pasted from #44550, discovered by @henriquebecker91

Metadata

Metadata

Assignees

No one assigned

    Labels

    bignumsBigInt and BigFloatbugIndicates an unexpected problem or unintended behavior

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions