kjokjo / ipcalc

Home Page:http://jodies.de/ipcalc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Probably a rounding error

Swiftyhu opened this issue · comments

Please see the attached output.

It is a Debian sid.

My issue is this output:
Used network: 100.64.50.0/24.999999999999999999999999999999999999999

` ipcalc -n -s 10 20 40 100.64.50.0/24
Address: 100.64.50.0 01100100.01000000.00110010. 00000000
Netmask: 255.255.255.0 = 24 11111111.11111111.11111111. 00000000
Wildcard: 0.0.0.255 00000000.00000000.00000000. 11111111
=>
Network: 100.64.50.0/24 01100100.01000000.00110010. 00000000
HostMin: 100.64.50.1 01100100.01000000.00110010. 00000001
HostMax: 100.64.50.254 01100100.01000000.00110010. 11111110
Broadcast: 100.64.50.255 01100100.01000000.00110010. 11111111
Hosts/Net: 254 Class A

  1. Requested size: 10 hosts
    Netmask: 255.255.255.248 = 29 11111111.11111111.11111111.11111 000
    Network: 100.64.50.96/29 01100100.01000000.00110010.01100 000
    HostMin: 100.64.50.97 01100100.01000000.00110010.01100 001
    HostMax: 100.64.50.102 01100100.01000000.00110010.01100 110
    Broadcast: 100.64.50.103 01100100.01000000.00110010.01100 111
    Hosts/Net: 6 Class A

  2. Requested size: 20 hosts
    Netmask: 255.255.255.224 = 27 11111111.11111111.11111111.111 00000
    Network: 100.64.50.64/27 01100100.01000000.00110010.010 00000
    HostMin: 100.64.50.65 01100100.01000000.00110010.010 00001
    HostMax: 100.64.50.94 01100100.01000000.00110010.010 11110
    Broadcast: 100.64.50.95 01100100.01000000.00110010.010 11111
    Hosts/Net: 30 Class A

  3. Requested size: 40 hosts
    Netmask: 255.255.255.224 = 27 11111111.11111111.11111111.111 00000
    Network: 100.64.50.0/27 01100100.01000000.00110010.000 00000
    HostMin: 100.64.50.1 01100100.01000000.00110010.000 00001
    HostMax: 100.64.50.30 01100100.01000000.00110010.000 11110
    Broadcast: 100.64.50.31 01100100.01000000.00110010.000 11111
    Hosts/Net: 30 Class A

Needed size: 112 addresses.
Used network: 100.64.50.0/24.999999999999999999999999999999999999999
Unused:
100.64.50.112/28
100.64.50.128/25`

commented

It was already fixed in a branch, I merge it to master now. Thank you for reporting the issue!