The concept of the $p$th variation of a continuous function $f$ along a refining sequence of partitions is the key to a pathwise Itô integration theory with integrator $f$. Here, we analyze the $p$th variation of a class of fractal functions, containing both the Takagi–van der Waerden and Weierstraß functions. We use a probabilistic argument to show that these functions have linear pth variation for a parameter $p ≥ 1$, which can be interpreted as the reciprocal Hurst parameter of the function. It is shown, moreover, that if functions are constructed from (a skewed version of) the tent map, then the slope of the $p$th variation can be computed from the $p$th moment of a (non-symmetric) infinite Bernoulli convolution. Finally, we provide a recursive formula of these moments and use it to discuss the existence and non-existence of a signed version of the $p$th variation, which occurs in pathwise Itô calculus when $p ≥ 3$ is an odd integer.