Simplified comparison logic for setting z-flag.