An optical comparator (often called just a comparator in context) or profile projector is a device that applies the principles of optics to the inspection of manufactured parts.
A digital comparator or magnitude comparator is a hardware electronic device that takes two numbers as input in binary form and determines whether one number is greater than, less than or equal to the other number.