On Sun, Oct 9, 2011 at 4:44 PM, Paul Bennett <paul.w.benn...@gmail.com> wrote:
> Ah, but an IP address *is* really a number. An unsigned 128-bit integer, in
> fact, with some additional properties that are specific to the semantics of
> IP addresses themselves.

Do you really want your end users to think of IP addresses as numbers?

> True, certain operations (multiplication and division spring to mind) are --
> probably -- bad ideas, but addition, subtraction, bitwise operations,
> bitshifting, comparison (including range comparison and sorting), and many
> other good numbery things definitely apply.

You're confusing implementation and interface. I'm not saying bigints
are a wrong implementation for this, I'm saying you shouldn't expose
that to your end users. Precisely because almost all numeric
operations do not make sense on an IP address.

Leon

Reply via email to