Skip to content

Unclear example for sign extension #26409

@333fred

Description

@333fred

The code example we have for CS0675 is not particularly clear, as it doesn't really show the problem: it just becomes 0x100000001, which is exactly what was asked for. Instead, we should probably show (long)1 | -1, as that will give 0xFFFFFFFF_FFFFFFFF rather than 0x00000001_FFFFFFFF, which is what one might expect to get when |ing an int and a long here. It would also be good to show the results of | operations, rather than just saying one is correct and one is not.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions