Signedness

Signedness

In computing, signedness is a property of variables 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 positive numbers.

Although this distinction is often made in computer processors, which require it to do arithmetic correctly, it is concealed by many programming languages. Generally, only low-level programming languages, such as assembly language and C, require programmers to make the distinction.

While "signed" numbers can represent negative numbers they lose a range of larger numbers which can only be represented with "unsigned" numbers of the same size (in bits).This is because in signed variables, one bit is used to indicate signedness, dividing the number of positive values that can be represented by two. Unsigned variables can dedicate all their bits to the positive number range.

ee also

*Sign bit
*Two's complement
*Signed number representations


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Sign (mathematics) — The plus and minus symbols are used to show the sign of a number. Not to be confused with the sine function in trigonometry. In mathematics, the word sign refers to the property of being positive or negative. Every nonzero real number is either… …   Wikipedia

  • unsignedness — noun The state or condition of being unsigned. Youre quite right: bits are bits, and the signedness or unsignedness of a given bit pattern depends strictly on your point of view. Ant: signedness …   Wiktionary

  • Integer (computer science) — In computer science, an integer is a datum of integral data type, a data type which represents some finite subset of the mathematical integers. Integral data types may be of different sizes and may or may not be allowed to contain negative values …   Wikipedia

  • Sign — A sign is an entity which signifies another entity. A natural sign is an entity which bears a causal relation to the signified entity, as thunder is a sign of storm. A conventional sign signifies by agreement, as a full stop signifies the end of… …   Wikipedia

  • Defensive programming — is a form of defensive design intended to ensure the continuing function of a piece of software in spite of unforeseeable usage of said software. The idea can be viewed as reducing or eliminating the prospect of Murphy s Law having effect.… …   Wikipedia

  • Type system — Type systems Type safety Inferred vs. Manifest Dynamic vs. Static Strong vs. Weak Nominal vs. Structural Dependent typing Duck typing Latent typing Linear typing Uniqueness typing …   Wikipedia

  • Unsigned (disambiguation) — Unsigned can refer to:* An unsigned artist is a musical artist or group not attached or signed to a record label. * Similarly, the contractual condition of any creative person or group. * Signedness; whether an integer variable includes data to… …   Wikipedia

  • Unix time — Unix time, or POSIX time, is a system for describing points in time, defined as the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1 1970, not counting leap seconds. It is widely used not only on Unix like… …   Wikipedia

  • Stdint.h — is a header file in the C standard library introduced in the C99 standard library section 7.18 to allow programmers to write more portable code by providing a set of typedefs that specify exact width integer types, together with the defined… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”