Skip to content

Can't represent 64-bit int using binary literal #212

Description

@YukinoHayakawa

I'm trying to store some data in binary literals, while they will be narrowed into 32-bit integers.
For example,

if(0b1111111111111111111111111111111111111111111111111111111111111111 != 0xFFFFFFFFFFFFFFFF)
{
    print(0b1111111111111111111111111111111111111111111111111111111111111111.to_string());
    print((0b1111111111111111111111111111111111111111111111111111111111111111 >> 31).to_string());
}

gives out:

4294967295
1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions