Skip to content

Add example with -2147483648 #309

@dj2

Description

@dj2

In 4.1.3 Integers section of the spec there is a set of examples listing some valid/invalid integers. Specifically it lists:

2147483648    // OK. Evaluates to -2147483648 (the literal set the sign bit)

But, if you do -2147483648, then you also get -2147483648 (the negation of -2147483648 is -2147483648), you can also do -(-2147483648) to get the same value.

So, it might be worthwhile noting that the negation of -2147483648 is itself?

(This is different then say -2147483649 which becomes 2147483647 because 2147483649 is -2147483647 which then negates as expected)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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