comparison: split range_comparison_to_param() into two functions