  The concept of the $p^{\text{th}}$ variation of a continuous function $f$
along a refining sequence of partitions is the key to a pathwise It\^o
integration theory with integrator $f$. Here, we analyze the $p^{\text{th}}$
variation of a class of fractal functions, containing both the Takagi--van der
Waerden and Weierstra\ss\ functions. We use a probabilistic argument to show
that these functions have linear $p^{\text{th}}$ variation for a parameter
$p\ge1$, 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^{\text{th}}$ variation can
be computed from the $p^{\text{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^{\text{th}}$ variation, which occurs in pathwise It\^o calculus when
$p\ge3$ is an odd integer.
