Height of a rational number (source code)

= Height of a rational number

For coprime integers $p,q$ with $q>0$,
$$
H(p/q)=\max\{|p|,q\}.
$$
This follows directly from the real and <p-adic absolute value>[p-adic absolute values], or from the <height-Mahler measure formula> for the primitive polynomial $qX-p$.