Let $p:\mathbb{R}^n\to[0,1)^n$ be the map defined by $p(x_1,\ldots,x_n)=(\{x_1\},\ldots,\{x_n\})$, where $\{\cdot\}$ is the fractional part operator. Experimentation suggests that if $S \subseteq \mathbb{R}^n$ is semialgebraic, then the closure of the image set $p(S)$ is semialgebraic. (By a "semialgebraic" subset of $\mathbb{R}^n$ I mean here a finite union of sets, each defined by a system of polynomial inequalities with real coefficients. By "closure" I mean in the usual topology on $\mathbb{R}^n$, restricted to $[0,1)^n$.)
Is this true? Can anyone provide a proof or a counterexample or a relevant reference?