implement template numerical comparison