TOPICS
Search

Integer Part


IntegerPart

The function intx gives the integer part of x. In many computer languages, the function is denoted int(x). It is related to the floor and ceiling functions |_x_| and [x] by

 int(x)={|_x_|   for x>=0; [x]   for x<0.
(1)

The integer part function satisfies

 int(-x)=-int(x)
(2)

and is implemented in the Wolfram Language as IntegerPart[x]. This definition is chosen so that int(x)+frac(x)=x, where frac(x) is the fractional part. Although Spanier and Oldham (1987) use the same definition as in the Wolfram Language, they mention the formula only very briefly and then say it will not be used further. Graham et al. (1994), and perhaps most other mathematicians, use the term "integer" part interchangeably with the floor function |_x_|.

IntegerPartReImAbs
Min Max
Re
Im Powered by webMathematica

The integer part function can also be extended to the complex plane, as illustrated above.

Since usage concerning fractional part/value and integer part/value can be confusing, the following table gives a summary of names and notations used. Here, S&O indicates Spanier and Oldham (1987).

notationnameS&OGraham et al. Wolfram Language
[x]ceiling function--ceiling, least integerCeiling[x]
mod(m,n)congruence----Mod[m, n]
|_x_|floor functionInt(x)floor, greatest integer, integer partFloor[x]
x-|_x_|fractional valuefrac(x)fractional part or {x}SawtoothWave[x]
sgn(x)(|x|-|_|x|_|)fractional partFp(x)no nameFractionalPart[x]
sgn(x)|_|x|_|integer partIp(x)no nameIntegerPart[x]
nint(x)nearest integer function----Round[x]
m\nquotient----Quotient[m, n]

See also

Ceiling Function, Floor Function, Fractional Part, Integer, Mod, Nearest Integer Function, Quotient

Related Wolfram sites

http://functions.wolfram.com/IntegerFunctions/IntegerPart/

Explore with Wolfram|Alpha

References

Graham, R. L.; Knuth, D. E.; and Patashnik, O. Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, p. 67, 1994.Spanier, J. and Oldham, K. B. "The Integer-Value Int(x) and Fractional-Value frac(x) Functions." Ch. 9 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 71-78, 1987.

Referenced on Wolfram|Alpha

Integer Part

Cite this as:

Weisstein, Eric W. "Integer Part." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/IntegerPart.html

Subject classifications