KhronosGroup / KhronosGroup/GLSL

Add example with `-2147483648`

Open Beginner friendly
#309 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
458
Forks
114
Avg merge
4m
Merged PRs (30d)
1

Description

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)

Contributor guide

Open the contributing guide

Research direction

Start with section 4.1.3, Integers, of the GLSL specification and review the existing valid and invalid integer examples. Update the example text to note the behavior of negating -2147483648, then verify that the surrounding integer semantics remain consistent.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.