Remove modulus from percentage calculation

Instead take the last part of ip, divide by 256 to get percentage and
compare to percentage passed in.
Merge pull request #1491 from jsbin/fix/ip-percentage

Remove modulus from percentage calculation