({{, (RefLink[Integer, paclet:ref/Integer])
is the head used for integers. }})

OpenersNotesSection(Spacer1)Details

_Integer can be used to stand for an integer in a pattern. »

Integers can be of any length. »

You can enter an integer in base b using b^^digits. The base must be less than 36. The letters are used in sequence to stand for digits 10 through 35. »

OpenersPrimaryExamplesSection(Spacer1)Examples  (11)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Enter an integer:

-12

(RefLink[Integer, paclet:ref/Integer]) is the (RefLink[Head, paclet:ref/Head]) used for integers:

Head[%]

OpenersExampleSection1(Spacer1)Scope  (5)

Enter a very large integer:

308301830183093810389108725092184914914891917449832749872947298472

Enter an integer in base 2:

2^^10110111011110111110111111011111110111111110111111111

Enter an integer in hexadecimal:

16^^fa0

Format an integer using base 2:

BaseForm[6455773865180671,2]

_Integer can be used to stand for an integer in a pattern:

MatchQ[1234,_Integer]

A rule that replaces integers with their reciprocals:

f[3,g[-4]] /.x_Integer->1/x

OpenersExampleSection2(Spacer1)Applications  (2)

Define a function that only works for integers:

divisibleby3[x_Integer]:=(Mod[x,3]==0)

Map[divisibleby3,{123,-40,3.14}]

Define a function that has a special case for integers:

fd[x_,k_,d_Integer]=D[x^k,x]

fd[x_,k_,d_]:=(Gamma[k+1]/Gamma[k-d+1])x^(k-d)

Make a surface plot of the fractional derivative of (x^k) at x=1 as a function of k and order:

Plot3D[fd[1,k,d],{k,0,2},{d,0,5},PlotRange->All]

OpenersExampleSection3(Spacer1)Properties & Relations  (3)

Integers are numbers:

NumberQ[1234]

Integers are atomic objects with no subexpressions:

AtomQ[1234]

Use (RefLink[Integers, paclet:ref/Integers]) to represent assumptions and indicate domain conditions:

Reduce[x^1000-2x^777+1==0,x,Integers]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[IntegerDigits, paclet:ref/IntegerDigits])  ▪  (RefLink[BaseForm, paclet:ref/BaseForm])  ▪  (RefLink[IntegerQ, paclet:ref/IntegerQ])  ▪  (RefLink[Integers, paclet:ref/Integers])  ▪  (RefLink[Rational, paclet:ref/Rational])  ▪  (RefLink[IntegerPart, paclet:ref/IntegerPart])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Types of Numbers, paclet:tutorial/TypesOfNumbers])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Patterns, paclet:guide/Patterns])}, {▪(RefLinkPlain[WDF (Wolfram Data Framework), paclet:guide/WDFWolframDataFramework])}, {▪(RefLinkPlain[Atomic Elements of Expressions, paclet:guide/AtomicElementsOfExpressions])}, {▪(RefLinkPlain[Representation of Numbers, paclet:guide/RepresentationOfNumbers])}, {▪(RefLinkPlain[Expression Structure, paclet:guide/ExpressionStructure])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/33-expressions-and-their-structure.html])(WebLink[: Expressions and Their Structure, https://www.wolfram.com/language/elementary-introduction/33-expressions-and-their-structure.html])}})}})