in the Numbers#compare method, cache the class of both params so we don't keep making unnecessary method calls