~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTEGER OVERFLOWS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Depends on the data type. Typical binary sizes for integers include 8 bits, 16 bits, 32 bits (the most common width for personal computers as of 2005), 64 bits, and 128 bits Ex.: 65536 % (65535 + 1) = 0 +---------------------------------------------+ Limit: 65535 or 1111 1111 1111 1111 Too big: 65536 or 1 0000 0000 0000 0000 What's stored: 0 or 0000 0000 0000 0000 +---------------------------------------------+ or 2's Compliment +---------------------------------------------+ Positive limit: 32767 or 0111 1111 1111 1111 Too big: 32768 or 1000 0000 0000 0000 What's stored: -32768 +---------------------------------------------+ Rsrc: http://www.tech-faq.com/integer-overflow.shtml ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ by Hugo Martin (c) www.hackcraft.com