Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Three large numbers

General Wesc (59919) writes | more than 10 years ago

User Journal 1

I'm looking for three large numbers that will add up to ten via overflow. I'm not sure how large the integers (or maybe even floats) are, so it may take some trial and error.I'm looking for three large numbers that will add up to ten via overflow. I'm not sure how large the integers (or maybe even floats) are, so it may take some trial and error.

cancel ×

1 comment

Sorry! There are no comments related to the filter you selected.

in C? (1)

Stavr0 (35032) | more than 10 years ago | (#8163011)

void main()
{
const unsigned long A = 1431655771;
const unsigned long B = 1431655768;
const unsigned long C = 1431655767;

unsigned long ten;

ten = a + b + c;

printf("%lu",ten);
}
Check for New Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>