> exponents is expressed like 2 ** 3 = 8;
>
> pwede rin ito:
>
> $bits=24;
> $fullmask = 2 ** 32;
> $netmask = $fullmask << (32-$bits);
> $hosts = $fullmask - $netmask;
> print "No. of hosts: $hosts\n";

i know this has already been way off topic :) but exponentiation with an
integer exponent and base 2 is easier done by having bit shifts <<

-andre



_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to