In theory, a bullet grazing the bottom of your foot is a hit but you could regard that as a hit or a miss. Try the following
if (topBullet >= topEnemy &&
bottomBullet <= bottomEnemy &&
leftBullet >= leftEnemy &&
rightBullet <= rightEnemy)
// What happens when the bullet hits
This will take care of the partial hits. The one in lazyfoo is for one particular case which is correct in the context of the example.