255 (number)
From Wikipedia, the free encyclopedia
255 | |
---|---|
Cardinal | Two hundred [and] fifty-five |
Ordinal | 255th (Two hundred [and] fifty-fifth) |
Factorization | |
Roman numeral | CCLV |
Binary | 11111111 |
Hexadecimal | FF |
255 (two hundred [and] fifty-five, CCLV) is the natural number following 254 and preceding 256.
[edit] In mathematics
Its factorization makes it a sphenic number. Since 255 = 28 - 1, it is a Mersenne number, and the fourth such number not to be a prime number. It is a perfect totient number, the smallest such number to be neither a power of three nor thrice a prime.
In base 10, it is a self number.
255 is a repdigit in base 2 (11111111) in base 4 (3333), and in base 16 (FF).
[edit] In computing
255 is a special number in some tasks having to do with computing. This is the maximum value representable by an eight-digit binary number, and therefore the maximum representable by an unsigned 8-bit byte (the most common size of byte, also called octet), the smallest common variable size used in high level programming languages (bit being smaller, but rarely used for value storage). The range is 0 to 255, which is 256 total values.
- 255 = 28 − 1 = FF16 = 111111112.
For example, 255 is the maximum value
- that can be assigned to elements in the 24-bit RGB color model, since each color channel is allotted eight bits.
- of any dotted quad in an IP address.
- of the Alpha blending scale in Delphi (255 being 100% visible and 0 being fully transparent)
This number occurs especially frequently in video games when a small number is needed, such as in the original The Legend of Zelda for the Nintendo Entertainment System where the maximum number of Rupees (the currency of the game) is 255. In Metroid Prime, for the Nintendo Gamecube, 255 is the maximum number of missiles Samus Aran can hold. In the Madden NFL series, the maximum points you can score is 255. If more points are scored, the game score remains at 255 regardless. In Starcraft, the maximum number of kills shown for a unit is 255. In Square Enix's Final Fantasy series, it is often the maximum value for any given stat. In Pac-Man, the highest level you can reach is 255, The game glitches from that point on. In World of Warcraft although the game level cap is only 70, the engine supports up to 255.
The usage of 8 bits for storage in older videogames has had the consequence of it appearing as a hard limit in many videogames. It was often used for numbers where casual gameplay would not cause anyone to exceed the number. However in most situations it is reachable given enough time. This can cause many other peculiarities similar to the above listed to appear when the number wraps back to 0.
This number could be interpreted by a computer as -1 if a programmer is not careful about which 8-bit values are signed and unsigned, and the two's complement representation of -1 in a signed byte is equal to that of 255 in an unsigned byte.