255 (number)
Encyclopedia
255 is the natural number
Natural number
In mathematics, the natural numbers are the ordinary whole numbers used for counting and ordering . These purposes are related to the linguistic notions of cardinal and ordinal numbers, respectively...

 following 254
254 (number)
254 is the natural number following 253 and preceding 255.254 is the number of counties in Texas.+254 is also the calling code of Kenya....

 and preceding 256
256 (number)
256 is the natural number following 255 and preceding 257.-In mathematics:256 is a composite number, with the factorization 256 = 28, which makes it a power of two....

.

In mathematics

Its factorization makes it a sphenic number
Sphenic number
In number theory, a sphenic number is a positive integer which is the product of three distinct prime numbers.Note that this definition is more stringent than simply requiring the integer to have exactly three prime factors; e.g. 60 = 22 × 3 × 5 has exactly 3 prime factors, but is not sphenic.All...

. Since 255 = 28 - 1, it is a Mersenne number, and the fourth such number not to be a prime number
Prime number
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. A natural number greater than 1 that is not a prime number is called a composite number. For example 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the divisors 2...

. It is a perfect totient number
Perfect totient number
In number theory, a perfect totient number is an integer that is equal to the sum of its iterated totients. That is, we apply the totient function to a number n, apply it again to the resulting totient, and so on, until the number 1 is reached, and add together the resulting sequence of numbers;...

, the smallest such number to be neither a power of three nor thrice a prime.

In base 10, it is a self number
Self number
A self number, Colombian number or Devlali number is an integer which, in a given base, cannot be generated by any other integer added to the sum of that other integer's digits. For example, 21 is not a self number, since it can be generated by the sum of 15 and the digits comprising 15, that is,...

.

255 is a repdigit
Repdigit
In recreational mathematics, a repdigit is a natural number composed of repeated instances of the same digit, most often in the decimal numeral system....

 in base 2 (11111111) in base 4 (3333), and in base 16 (FF).

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
Binary numeral system
The binary numeral system, or base-2 number system, represents numeric values using two symbols, 0 and 1. More specifically, the usual base-2 system is a positional notation with a radix of 2...

 number, and therefore the maximum representable by an unsigned 8-bit byte
Byte
The byte is a unit of digital information in computing and telecommunications that most commonly consists of eight bits. Historically, a byte was the number of bits used to encode a single character of text in a computer and for this reason it is the basic addressable element in many computer...

 (the most common size of byte, also called an octet
Octet (computing)
An octet is a unit of digital information in computing and telecommunications that consists of eight bits. The term is often used when the term byte might be ambiguous, as there is no standard for the size of the byte.-Overview:...

), the smallest common variable
Variable (programming)
In computer programming, a variable is a symbolic name given to some known or unknown quantity or information, for the purpose of allowing the name to be used independently of the information it represents...

 size used in high level programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

s (bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

 being smaller, but rarely used for value storage). The range is 0
0 (number)
0 is both a numberand the numerical digit used to represent that number in numerals.It fulfills a central role in mathematics as the additive identity of the integers, real numbers, and many other algebraic structures. As a digit, 0 is used as a placeholder in place value systems...

 to 255, which is 256
256 (number)
256 is the natural number following 255 and preceding 257.-In mathematics:256 is a composite number, with the factorization 256 = 28, which makes it a power of two....

 total values.


For example, 255 is the maximum value
  • that can be assigned to elements in the 24-bit RGB color
    Color
    Color or colour is the visual perceptual property corresponding in humans to the categories called red, green, blue and others. Color derives from the spectrum of light interacting in the eye with the spectral sensitivities of the light receptors...

     model, since each color channel is allotted eight bits.
  • of any dotted quad in an IP address
    IP address
    An Internet Protocol address is a numerical label assigned to each device participating in a computer network that uses the Internet Protocol for communication. An IP address serves two principal functions: host or network interface identification and location addressing...

    .
  • of the alpha blending scale in Delphi (255 being 100% visible and 0 being fully transparent)


The use of eight bits for storage in older video games has had the consequence of it appearing as a hard limit in many video games. In the earlier versions of The Legend of Zelda
The Legend of Zelda
The Legend of Zelda, originally released as in Japan, is a video game developed and published by Nintendo, and designed by Shigeru Miyamoto and Takashi Tezuka. Set in the fantasy land of Hyrule, the plot centers on a boy named Link, the playable protagonist, who aims to collect the eight fragments...

, Link can carry a maximum of 255 rupees. 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 to appear when the number wraps back to 0.

This number could be interpreted by a computer as −1
-1 (number)
In mathematics, −1 is the additive inverse of 1, that is, the number that when added to 1 gives the additive identity element, 0. It is the negative integer greater than negative two and less than 0....

 if a programmer is not careful about which 8-bit values are signed
Signedness
In computing, signedness is a property of data types representing numbers in computer programs. A numeric variable is signed if it can represent both positive and negative numbers, and unsigned if it can only represent non-negative numbers .As signed numbers can represent negative numbers, they...

 and unsigned, and the two's complement
Two's complement
The two's complement of a binary number is defined as the value obtained by subtracting the number from a large power of two...

representation of −1 in a signed byte is equal to that of 255 in an unsigned byte.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK