Integer

In mathematics, integers are whole numbers (natural numbers, their negatives, and zero).[1] Integers can also be shown on a number line like this:

Integer

In mathematics, integers are whole numbers (natural numbers, their negatives, and zero).[1] Integers can also be shown on a number line like this:

In particular, zero or 0 is an integer that is neither positive nor negative. An integer is a whole number with no fractional or decimal part.

Integers have no smallest or largest value because for any given integer, there is always a larger and smaller integer. Any integer is either greater than or smaller than any other integer. Consecutive integers are integers that come after each other (as in ).

The sum, difference, and product of integers is always an integer.

  • For example, (12 + 2345 × (67 - 8)) × 9 is an integer.

An integer divided by an integer is sometimes not an integer.

  • For example, 1 ÷ 2 = 0.5.


or is the name of the set of integers, and is the set of positive integers.[2][3] (, +, 0) is an abelian group.

The number of integers is infinite. The cardinal number of is . The ordinal number of is .

To sum up, an integer is a whole number that has no decimals.

In programming

In some programming languages, like C and Python, there are types called "int" or "integer."

Somewhat confusingly [4] , integers don't always correspond to exactly one type in a programming language, such as:

  • char, short, int, long, long long in C
  • int, bignum in Python

All seven of the above types are integers.


"Unsigned" integers are not allowed to have a negative sign, such as

"Signed" integers are allowed to have a negative sign (or positive sign or no sign), such as

Notes

  1. ↑ Negative numbers have a minus (−) in front of the number. Positive numbers have no sign or a plus (+) sign in front. Zero usually has no sign, but in rare cases such as One's Complement and Sign-magnitude, both and co-exist.
  2. ↑ "Comprehensive List of Algebra Symbols". Math Vault. 2020-03-25. Retrieved 2020-08-11.
  3. ↑ Weisstein, Eric W. "Integer". mathworld.wolfram.com. Retrieved 2020-08-11.
  4. ↑ Multiple types exist for integers due to the biggest and smallest representable numbers varying among the types.


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.