Thanks Eric

Excellent. Also faster. I thought about changing to Horner's method (what
you used) but I was too tired. BTW, the local 'z is now superfluous.

Cheers
-Larry

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: Larry Palmiter <[EMAIL PROTECTED]>
Sent: Tuesday, August 01, 2000 9:00 AM
Subject: [REBOL] converting I.P. Addresses to integer Re:


>
> Hi Larry,
>
> You wrote:
>
> >tup-to-num: func [x /local out][
> > out: 0.0
> > x: head reverse parse to-string x "."
> > repeat j 4 [
> >  out: out + (256.0 ** (j - 1) * to-integer x/:j)
> > ]
> >]
>
> How about ... ?
>
> tup-to-num2: func [x /local z out][
>   out: 0.0
>   repeat j length? x [
>     out: out * 256 + pick x j
>   ]
> ]
>
> See you,
> Eric
>

Reply via email to