y=xxy = x - \lfloor x \rfloor

Graph of the Fractional Part y=xxy = x - \lfloor x \rfloor (Sawtooth Wave)

y=xxy = x - \lfloor x \rfloor extracts the fractional part of xx, often written {x}\{x\}. Subtracting the floor x\lfloor x \rfloor (the greatest integer not exceeding xx) removes the integer part and leaves only the fraction.

  • 2.32.3=2.32=0.32.3 - \lfloor 2.3 \rfloor = 2.3 - 2 = 0.3
  • 55=55=05 - \lfloor 5 \rfloor = 5 - 5 = 0
  • 1.21.2=1.2(2)=0.8-1.2 - \lfloor -1.2 \rfloor = -1.2 - (-2) = 0.8

For negative numbers the floor returns the integer below, so the result is always non-negative. Note that the fractional part of 1.2-1.2 is 0.80.8, which is slightly counter-intuitive.

Domain and range. The domain is all real numbers and the range is 0y<10 \leq y < 1, the interval [0, 1)[0,\ 1). The value never reaches 11.

Periodicity and shape. The function has period 11, with {x+1}={x}\{x + 1\} = \{x\}. On each integer interval [n, n+1)[n,\ n+1) it is the line y=xny = x - n of slope 11: it starts at 00 when x=nx = n, rises straight up, and approaches 11 just before the next integer. Because this shape repeats, the graph is called a sawtooth wave.

Discontinuities and jumps. The function is discontinuous at every integer. Approaching an integer nn from the left the value tends to 11, but at x=nx = n it resets to 00. Each jump therefore has size 1-1: the value climbs almost to the ceiling, then drops to the floor, over and over. Each step includes its left end (the integer point, value 00) but not its right end, so it is right-continuous.

Relation to other functions. The fractional part is built from the floor function, and xxx - \lfloor x \rfloor equals the remainder xmod1x \bmod 1. Only at integers do xx and its floor coincide, making the value 00.

Applications. The sawtooth wave is widely used in signal processing: as the oscillator of an audio synthesizer, and as a phase accumulator that repeatedly advances a phase from 00 to 11 (or 00 to 2π2\pi). It is also a classic example for Fourier series.