I have two IP Addresses. To decide whether or not two IP addresses are on the same network, we use a subnet mask. This is used to mask the network portion of the IP Address. The network portion of the IP address has a 1 in the corresponding bit of the subnet mask. The host portion of the IP has a 0 in the corresponding bit of the subnet mask.
Lets take a look at the subnet mask in binary form.
Class A addressing. Both of the above IP's are on the same network.