implemented comparator between number and rational