Newbie Question about high-order bit 
Author Message
 Newbie Question about high-order bit

Hi

I am new to programming. Could some one please explain how the
"high-order" bit in a signed integer decides if the INT is +ve/-ve. The
explanation in a book I've been reading "C: The Complete Reference - 4th
Ed" by Herbert Schildt is very limited.

Any guidance would be greatly appreciated
--
Lots of Luck

theN



Thu, 11 Nov 2004 07:08:13 GMT  
 Newbie Question about high-order bit

Quote:

> Hi

> I am new to programming. Could some one please explain how the
> "high-order" bit in a signed integer decides if the INT is +ve/-ve. The
> explanation in a book I've been reading "C: The Complete Reference - 4th
> Ed" by Herbert Schildt is very limited.

> Any guidance would be greatly appreciated

1.  Why do you care?

2.  I'm not sure the C standard has anything to say about the representation
    of the sign bit for integral types.  So, bit-twiddling with anything other
    than unsigned types is likely to require some knowledge of the platform's
    representation of such types.  See ones-complement vs. twos-complement and
    byte order issues.



Thu, 11 Nov 2004 07:58:32 GMT  
 Newbie Question about high-order bit
Quote:

> Hi

> I am new to programming. Could some one please explain how the
> "high-order" bit in a signed integer decides if the INT is +ve/-ve. The
> explanation in a book I've been reading "C: The Complete Reference - 4th
> Ed" by Herbert Schildt is very limited.

          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Quote:
> Any guidance would be greatly appreciated

Do yourself a favour and don't ever read any book written by Herbert
Schildt.


Thu, 11 Nov 2004 08:58:48 GMT  
 Newbie Question about high-order bit

Quote:
theN writes:
> I am new to programming. Could some one please explain how the
> "high-order" bit in a signed integer decides if the INT is +ve/-ve. The
> explanation in a book I've been reading "C: The Complete Reference - 4th
> Ed" by Herbert Schildt is very limited.

Most modern computers use a form called "two's complement" to represent
signed numbers.  Here is a fairly nice write up which explains the key
differences between that form and its competitor, one's complement.  I don't
think there is much there on the theoretical base but there is almost surely
something available on the net if you have a little patience.

http://webster.commnet.edu/roger/binary%20number%20section/bin1-5.htm

Note that nine's complement and ten's complement can be used with decimal
numbers.



Thu, 11 Nov 2004 11:10:41 GMT  
 Newbie Question about high-order bit

Quote:
>     representation of such types.  See ones-complement vs. twos-complement
and
>     byte order issues.

What's so great about one's complement anyway? (your reply is accurate and
to-the-point, so I thought you would be the right person to ask).


Thu, 11 Nov 2004 09:41:52 GMT  
 Newbie Question about high-order bit

Quote:
>>     representation of such types.  See ones-complement vs. twos-complement
> and
>>     byte order issues.

> What's so great about one's complement anyway? (your reply is accurate and
> to-the-point, so I thought you would be the right person to ask).

Others may be in a better position to argue the merits of one vs. the other.


Thu, 11 Nov 2004 10:08:52 GMT  
 Newbie Question about high-order bit

Quote:

> I am new to programming. Could some one please explain how the
> "high-order" bit in a signed integer decides if the INT is
> +ve/-ve. The explanation in a book I've been reading "C: The
> Complete Reference - 4th Ed" by Herbert Schildt is very limited.

Get another book.  There are reasons he is known as bull-shildt.

--

   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!



Thu, 11 Nov 2004 10:42:10 GMT  
 Newbie Question about high-order bit

Quote:

> Do yourself a favour and don't ever read any book written by Herbert
> Schildt.

Really?  I've found his books quite useful.  Granted, not as learn-to
books, but as reference books.

-Alex



Fri, 12 Nov 2004 06:45:42 GMT  
 Newbie Question about high-order bit

Quote:

>> Do yourself a favour and don't ever read any book written by Herbert
>> Schildt.

> Really?  I've found his books quite useful.  Granted, not as learn-to
> books, but as reference books.

> -Alex

Thanks all for the help and guidance.

I do have a simple request though - I would be very grateful if some one
suggested a good book, instead of simply saying that Herbert Schildt is
not good.

I thank once again all those who've taken time to respond.

--
Lots of Luck

theN



Fri, 12 Nov 2004 07:07:08 GMT  
 Newbie Question about high-order bit


Quote:
>I do have a simple request though - I would be very grateful if some one
>suggested a good book, instead of simply saying that Herbert Schildt is
>not good.

Richard Heathfield's site http://users.powernet.co.uk/eton/ and Billy
Chambless regular "welcome" posting here both have some
recommendations, as does ACCU's website I think - Lawrence do you
maintain that?

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>



Fri, 12 Nov 2004 07:28:50 GMT  
 Newbie Question about high-order bit

Quote:



> >I do have a simple request though - I would be very grateful if some one
> >suggested a good book, instead of simply saying that Herbert Schildt is
> >not good.

> Richard Heathfield's site http://users.powernet.co.uk/eton/

Specifically, http://users.powernet.co.uk/eton/clc/cbooks.html

Quote:
> and Billy
> Chambless regular "welcome" posting here both have some
> recommendations, as does ACCU's website I think - Lawrence do you
> maintain that?

ITYM Francis Glassborow.

--

"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton



Fri, 12 Nov 2004 13:06:05 GMT  
 Newbie Question about high-order bit

Quote:
>I do have a simple request though - I would be very grateful if some one
>suggested a good book, instead of simply saying that Herbert Schildt is
>not good.

K&R2.  See the References section of the FAQ for details.

Dan
--
Dan Pop
DESY Zeuthen, RZ group



Fri, 12 Nov 2004 21:21:53 GMT  
 Newbie Question about high-order bit
On Mon, 27 May 2002 06:06:05 +0100, Richard Heathfield

Quote:


>> and Billy
>> Chambless regular "welcome" posting here both have some
>> recommendations, as does ACCU's website I think - Lawrence do you
>> maintain that?

>ITYM Francis Glassborow.

You're quite right - sorry Francis.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>


Sat, 13 Nov 2004 05:28:16 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. High Order Bit

2. High-order bit etc

3. Q: how to check the high order bit?

4. High order/low order problem

5. Writting low-order or high-order bytes

6. byte order and bit order

7. bit ordering question

8. Newbie question: byte order

9. Separate low and high order ints

10. ** Getting the High Order Byte **

11. Warning: CFile::GetStatus() returns m_attribute without high-order flags

12. High-order word...

 

 
Powered by phpBB® Forum Software