e01.org

Integer (computer science)

In computer science, an integer is a datum of integral data type, a data type that represents some range of mathematical integers. Integral data types may be of different sizes and may or may not be allowed to contain negative values. Integers are commonly represented in a computer as a group of binary digits (bits). The size of the grouping varies so the set of integer sizes available varies between different types of computers. Computer hardware nearly always provides a way to represent a processor register or memory address as an integer.

In computer science, an integer is a datum of integral data type, a data type that represents some range of mathematical integers. Integral data types may be of different sizes and may or may not be allowed to contain negative values. Integers are commonly represented in a computer as a group of binary digits (bits). The size of the grouping varies so the set of integer sizes available varies between different types of computers. Computer hardware nearly always provides a way to represent a processor register or memory address as an integer.

References

  1. ^ "Integer". A Dictionary of Computer Science . Oxford University Press. 21 January 2016. ISBN 978-0-19-968897-5 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  2. ^ "BigInteger (Java Platform SE 6)" . Oracle . Retrieved 2011-09-11 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1315695600.0
  3. ^ Thorsten Leemhuis (2011-09-13). "Kernel Log: x32 ABI gets around 64-bit drawbacks" . www.h-online.com. Archived from the original on 28 October 2011 . Retrieved 2011-11-01 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1320102000.0
  4. ^ Cheever, Eric. "Representation of numbers" . Swarthmore College . Retrieved 2011-09-11 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1315695600.0
  5. ^ The ISO C standard allows implementations to reserve the value with sign bit 1 and all other bits 0 (for sign–magnitude and two's complement representation) or with all bits 1 (for ones' complement) for use as a "trap" value, used to indicate (for example) an overflow. [ 12 ] Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  6. ^ "Fundamental types in C++" . cppreference.com. Archived from the original on 13 June 2011 . Retrieved 5 December 2010 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  7. ^ "Chapter 8.6.2 on page 12" (PDF) . ecma-international.org. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  8. ^ VB 6.0 help file Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  9. ^ "The Integer, Long, and Byte Data Types (VBA)" . microsoft.com . Retrieved 2006-12-19 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1166482800.0
  10. ^ Giguere, Eric (December 18, 1987). "The ANSI Standard: A Summary for the C Programmer" . Retrieved 2010-09-04 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1283554800.0
  11. ^ "American National Standard Programming Language C specifies the syntax and semantics of programs written in the C programming language" . Archived from the original on 2010-08-22 . Retrieved 2010-09-04 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1283554800.0
  12. ^ "PHP: Integers - Manual" . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  13. ^ ECMAScript 6th Edition draft: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-numeric-literals Archived 2013-12-16 at the Wayback Machine Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  14. ^ "SmallBASIC | MAXINT" . Retrieved 2025-01-20 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1737327600.0
  15. ^ Madhusudhan Konda (2011-09-02). "A look at Java 7's new features - O'Reilly Radar" . Radar.oreilly.com . Retrieved 2013-10-15 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1381791600.0
  16. ^ "Integer (Java Platform SE 8 )" . Retrieved 2025-01-20 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1737327600.0
  17. ^ "Numeric limits" . cppreference.com. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  18. ^ "Limits of Basic Types" . Retrieved 2025-01-20 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1737327600.0
  19. ^ "std::numeric_limits" . cppreference.com. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  20. ^ "Prelude" . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  21. ^ "28.1. sys — System-specific parameters and functions — Python 2.7.18 documentation" . docs.python.org . Retrieved 17 September 2025 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  22. ^ "sys — System-specific parameters and functions" . Python 3.13.7 documentation . Retrieved 17 September 2025 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  23. ^ "Primitive Type i32" . doc.rust-lang.org/std. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  24. ^ Grogono, Peter (1995). Programming with Turing and Object Oriented Turing . New York: Springer. p. 363. doi : 10.1007/978-1-4612-4238-3 . ISBN 978-0-387-94517-0 . LCCN 95010802 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  25. ^ Barr, Adam (2018-10-23). The Problem with Software: Why Smart Engineers Write Bad Code . MIT Press. ISBN 978-0-262-34821-8 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  26. ^ "MySQL 5.6 Numeric Datatypes" . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  27. ^ "Sybase Adaptive Server Enterprise 15.5: Exact Numeric Datatypes" . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  28. ^ a b c d e Fog, Agner (2010-02-16). "Calling conventions for different C++ compilers and operating systems: Chapter 3, Data Representation" (PDF) . Retrieved 2010-08-30 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1283122800.0
  29. ^ a b c "ISO/IEC 9899:201x" (PDF) . open-std.org. section 5.2.4.2.1 . Retrieved 2016-06-20 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1466377200.0
  30. ^ a b c d "ISO/IEC 9899:201x" (PDF) . open-std.org. section 6.2.6.2, paragraph 2 . Retrieved 2016-06-20 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1466377200.0
  31. ^ Giguere, Eric (1987-12-18). "The ANSI Standard: A Summary for the C Programmer" . Retrieved 2010-09-04 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1283554800.0
  32. ^ a b Meyers, Randy (2000-12-01). "The New C: Integers in C99, Part 1" . drdobbs.com . Retrieved 2010-09-04 . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1283554800.0
  33. ^ a b c d Fortan uses 'kinds' to control the size of integers. Parameterized constants defining the available kinds are available in the iso_fortran_env intrinsic module. Constants defining C compatible kinds are available in the iso_c_binding intrinsic module. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  34. ^ a b Reserved for future use. Not implemented yet. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  35. ^ a b The sizes of Delphi's Integer and Cardinal are not guaranteed, varying from platform to platform; usually defined as LongInt and LongWord respectively. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  36. ^ Java does not directly support arithmetic on char types. The results must be cast back into char from an int . Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  37. ^ a b c d e f g h i j k l m n The sizes of char , short , int , long and long long in C/C++ are dependent upon the implementation of the language. Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  38. ^ Not all SQL dialects have unsigned datatypes. [ 5 ] [ 6 ] Wikipedia revision 1359775304, retrieved 2026-11-21 · 1795215600.0
  39. A Dictionary of Computer Science . Oxford University Press . 21 January 2016. · 1781650800.0
  40. ISO/IEC 9899:201x . open-std.org . retrieved 2016-06-20 · 1466377200.0
  41. {| class="wikitable" |+ Common short integer sizes |- ! Programming language ! Data type name ! Signedness ! Size in bytes ! Minimum value ! Maximum value |- | rowspan="2" | C (programmi . · 1781650800.0
  42. Chapter 8.6.2 on page 12 . ecma-international.org . · 1781650800.0
  43. The Integer, Long, and Byte Data Types (VBA) . microsoft.com . retrieved 2006-12-19 · 1166482800.0
  44. to nowrap|2 63 − 1 for signed and 0 to nowrap|2 64 − 1 for unsigned, must be fulfilled; however, extending this range is permitted. cite web| url=http://www.ericgiguere.com/articles/ansi-c-s . · 1781650800.0
  45. American National Standard Programming Language C specifies the syntax and semantics of programs written in the C programming language . · 1781650800.0
  46. PHP: Integers - Manual . · 1781650800.0
  47. ECMAScript 6th Edition draft: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-numeric-literals webarchive|url=https://web.archive.org/web/20131216202526/https://people.mozilla.org . · 1781650800.0
  48. SmallBASIC ! MAXINT . retrieved 2025-01-20 · 1737327600.0
  49. Integer (Java Platform SE 8 ) . retrieved 2025-01-20 · 1737327600.0
  50. Cheever, Eric. Representation of numbers . Swarthmore College . retrieved 2011-09-11 · 1315695600.0
  51. Numeric limits . cppreference.com . · 1781650800.0
  52. Limits of Basic Types . retrieved 2025-01-20 · 1737327600.0
  53. std::numeric_limits . cppreference.com . · 1781650800.0
  54. Prelude . · 1781650800.0
  55. 28.1. sys — System-specific parameters and functions — Python 2.7.18 documentation . docs.python.org . · 1781650800.0
  56. sys — System-specific parameters and functions . Python 3.13.7 documentation . retrieved 17 September 2025 · 1781650800.0
  57. Primitive Type i32 . doc.rust-lang.org/std . · 1781650800.0
  58. Meyers, Randy. The New C: Integers in C99, Part 1 . drdobbs.com . 2000-12-01. retrieved 2010-09-04 · 1283554800.0
  59. Giguere, Eric. The ANSI Standard: A Summary for the C Programmer . 1987-12-18. retrieved 2010-09-04 · 1283554800.0
  60. Calling conventions for different C++ compilers and operating systems: Chapter 3, Data Representation . 2010-02-16. · 1781650800.0
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Integer (computer science)". 1781660400. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1359775304

JSON record · API collection · citation policy