Fractional Part

The function frac(x) giving the fractional (noninteger) part of a real number x. The symbol {x} is sometimes used instead of frac(x) (Graham et al. 1994, p. 70; Havil 2003, p. 109), but this notation is not used in this work due to possible confusion with the set containing the element x.


Unfortunately, there is no universal agreement on the meaning of frac(x) for x<0 and there are two common definitions. Let |_x_| be the floor function, then the Wolfram Language command FractionalPart[x] is defined as

 frac(x)={x-|_x_|   x>=0; x-[x]   x<0

(left figure). This definition has the benefit that frac(x)+int(x)=x, where int(x) is the integer part of x. Although Spanier and Oldham (1987) use the same definition as the Wolfram Language, they mention the formula only very briefly and then say it will not be used further. Graham et al. (1994, p. 70), and perhaps most other mathematicians, use the different definition


(right figure).

Min Max
Im Powered by webMathematica

The fractional part function can also be extended to the complex plane as


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]

The (possibly scaled) periodic waveform corresponding to the latter definition is known as the sawtooth wave.


The fractional part of 1/x, illustrated above, has the interesting analytic integrals


The integral


is therefore a telescoping sum given by


where gamma is the Euler-Mascheroni constant and H_n is the harmonic number.


An additional related integral that can be done in closed form and gives the same result is


(Havil 2003, pp. 109-111).


The plot above shows the fractional parts of nlnn for 1<=n<=10^5, showing characteristic gaps (Trott 2004, p. 223).

A consequence of Weyl's criterion is that the sequence {frac(nx)} is dense and equidistributed in the interval [0,1] for irrational x, where n=1, 2, ... (Finch 2003).

See also

Beatty Sequence, Ceiling Function, Equidistributed Sequence, Floor Function, Gauss Map, Integer Part, Mod, Nearest Integer Function, Power Fractional Parts, Quotient, Sawtooth Wave, Shift Transformation, Truncate, Whole Number

Related Wolfram sites

Explore with Wolfram|Alpha


Finch, S. R. "Powers of 3/2 Modulo One." §2.30.1 in Mathematical Constants. Cambridge, England: Cambridge University Press, pp. 194-199, 2003.Graham, R. L.; Knuth, D. E.; and Patashnik, O. Concrete Mathematics: A Foundation for Computer Science, 2nd ed. Reading, MA: Addison-Wesley, 1994.Havil, J. Gamma: Exploring Euler's Constant. Princeton, NJ: Princeton University Press, pp. 109-110, 2003.Miklavc, A. "Elementary Proofs of Two Theorems on the Distribution of Numbers {nx} (mod 1)." Proc. Amer. Math. Soc. 39, 279-280, 1973.Sloane, N. J. A. Sequence A000079/M1129 in "The On-Line Encyclopedia of Integer Sequences."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.Trott, M. The Mathematica GuideBook for Programming. New York: Springer-Verlag, 2004.

Referenced on Wolfram|Alpha

Fractional Part

Cite this as:

Weisstein, Eric W. "Fractional Part." From MathWorld--A Wolfram Web Resource.

Subject classifications