10111111 = 191
11111000 = 248
Carry the bits where theres a one on line two and you get
10111000 = 184
So its correct as far as I can see, the corresponding bytes are ONLY identical when the subnet has 255 (11111111) in the same byte as all bits are then carried from the IP to the gateway address "as is", anywhere there's a 0 you dont copy that bit across so on the 248 mask any 1's in the last three bytes arent copied to the subnet
But the proof is in the pudding, if its working its ok