• Post Reply Bookmark Topic Watch Topic
  • New Topic

Division by 4 or 8 for the last bit of ip address  RSS feed

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning every body
i hope you are fine

so i do an function to keep the last bit of ip address and do some operations on it and the result replace it in the last number

the operation is to take the last bit and divise it by 8
but i have 2 cases
address that the mask address it's /30 so i must divise the last bit of ip address by 4
but if the mask it's /28 i must divised it by 8

so i don't know how can i do this tests and keep the result

this is my function for divise the last bit by 8 and replace the result

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!