Jump to content
  • Advertisement
Sign in to follow this  
SpiderPigSpiderPig

Bad suffix on number error

This topic is 2219 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to get some c++ code I've found on the net to work in MSVC++ and i'm getting a 'bad suffix on number' error.

See below 3 lines where there's an number format I'm not familiar with each ending in 'U' which the compiler doesn't like. Please could someone advise of the correct MSVC++ format for these and maybe point me in the direction of an explanation of what these numbers mean.

Thanks !! :-)

uint64_t x1 = x - ((x & 0xAAAAAAAAAAAAAAAALLU) >> 1);
uint64_t x2 = (x1 & 0x3333333333333333LLU) + ((x1 >> 2) & 0x3333333333333333LLU);
uint64_t x3 = (x2 + (x2 >> 4)) & 0x0F0F0F0F0F0F0F0FLLU;

Share this post


Link to post
Share on other sites
Advertisement
ull or llu stands for unsigned long long. I would advise you to use a mixed capitalisation when using this on a hex number just so you can easily see where the hex value stops and where the number suffix starts.

http://msdn.microsoft.com/en-us/library/00a1awxf%28v=vs.80%29.aspx link on the syntax MSVC uses for it's integral suffix parsing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!