Classifying rational and irrational numbers