The 24 is the size of subnet.

To really calculate if both ips are in the same subnet you would have to write the ip as binary (windows calculator is your friend ;)):

```
decimal: 10.0.0.10/24
binary: 00001010.00000000.00000000.00001010
the first 24 bits are the subnet:
00001010.00000000.00000000.xxxxxxxx
```

and

```
decimal: 30.0.0.10/24
binary: 00011110.00000000.00000000.00001010
the first 24 bits are the subnet:
00011110.00000000.00000000.xxxxxxxx
```

So if boths subnets are identical, the IPs are on the same subnet.

The subnets are different: -> 10.0.0.0/24 and 30.0.0.10/24 are on different subnets.

"24" is a special subnet. 24 bits are 3 bytes (the first three blocks of the ip are the subnet).

So you don't have to mess up with bits.

```
30.0.0.10/24 -> subnet: 30.0.0.x (correctly written as 30.0.0.0/24)
10.0.0.10/24 -> subnet: 10.0.0.x (correctly written as 10.0.0.0/24)
```

Example for two ips in identical subnets:

- 10.0.0.30/24
- 10.0.0.10/24

see http://en.wikipedia.org/wiki/Subnetwork for more details.