Thoughts on unified integer literal improvements

Paul Benedict pbenedict at apache.org
Thu May 28 01:05:52 PDT 2009


On Thu, May 28, 2009 at 2:54 AM, Joseph D. Darcy wrote:
> With this proposal, Java would have unsigned int literals but only a
> *signed* int type.

I still don't like the 'y' or 's' suffixes.

As was being proposed:
int i = 0xFFy; // -128
int i = 0xFFu; // 127

But I would prefer an outright negative symbol in addition to the suffix:
int i = -0xFFu;  // -128
int i = 0xFFu; // 127

And maybe even enforcing wrapping it in parenthesis before negating it:
int i = -(0xFFu);  // -128

Paul



More information about the coin-dev mailing list