Check if variable equals a constant