LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-01-2015, 09:31 PM   #1
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Rep: Reputation: Disabled
How 2^0 can be considered as 1 in IP Address


Hi,


In IP addressing, when we consider 2^1 is 2, then how 2^0 can be considered as 1 ???
My expectation is, 2^0 should be 0


Representation of single octet:
2^8 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
256 128 64 32 16 8 4 2 1

Last edited by arun natarajan; 10-01-2015 at 09:34 PM.
 
Old 10-01-2015, 09:35 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
What do you imagine 2^0 equals?
 
Old 10-01-2015, 09:50 PM   #3
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Original Poster
Rep: Reputation: Disabled
for me, 2^0 is 0 ...i.e 2*0=0
 
Old 10-01-2015, 10:03 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,930

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
2^0 is not the same thing as 2*0
http://www.exploringbinary.com/the-laws-of-exponents/

I forgot to mention that an octet is 8 bits which is 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0 i.e has a value of 0 - 255 not 256.

Last edited by michaelk; 10-02-2015 at 01:09 PM.
 
Old 10-02-2015, 11:21 AM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
2^0 is and always has been 1 in mathematics...
 
Old 10-02-2015, 11:23 AM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Read: Two(2) to the power of(^) zero(0) is equal(=) to one(1)

Explanation of why: http://mathforum.org/dr.math/faq/faq...to.0power.html
 
Old 10-02-2015, 01:06 PM   #7
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Original Poster
Rep: Reputation: Disabled
Thank you all. Got the answer now.
 
Old 10-02-2015, 01:53 PM   #8
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,244

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Just to be clear ... any number to the power of 0 is 1
 
Old 10-02-2015, 02:00 PM   #9
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Quote:
Just to be clear ... any number to the power of 0 is 1
Because:

Code:
    5^2
1 = --- = 5^(2-2) = 5^0 = 1
    5^2
 
Old 10-02-2015, 06:52 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 5,993

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
To simplify, or complicate, I see the positions within a binary string either on or off so, yes, when position 0 is on that represents 1 but when it is off it represent 0. So it is consistent with the rest.
 
Old 10-03-2015, 02:23 AM   #11
arun natarajan
Member
 
Registered: Jun 2014
Posts: 96

Original Poster
Rep: Reputation: Disabled
Thanks once again. For clear explanation.
 
Old 10-03-2015, 07:31 AM   #12
JeremyBoden
Member
 
Registered: Nov 2011
Posts: 938

Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by grail View Post
Just to be clear ... any number to the power of 0 is 1
Except 0 to the power 0, which isn't defined.
 
Old 10-03-2015, 07:53 AM   #13
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 5,993

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
Quote:
Originally Posted by JeremyBoden View Post
Except 0 to the power 0, which isn't defined.
I thought it was your mother's mother?
(Sorry, very poor joke I felt compelled to make.)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Have you considered suicide? mitchell7man General 75 05-31-2009 08:19 AM
Why is Fedora considered unstable? SlowCoder Fedora 5 02-24-2009 04:58 AM
Why I never considered using Windows as a server and never will ErrorBound Linux - Server 2 05-08-2007 09:59 PM
What is considered 'advertising' Squall LQ Suggestions & Feedback 3 09-02-2004 08:42 PM
email considered spam kubicon Linux - Networking 4 02-02-2004 01:46 PM


All times are GMT -5. The time now is 02:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration