Compare to k rather than a hard-coded constant