Re: negative hex



On Sun, 29 Jun 2008 19:40:54 +0100, richard
<mullens-deleteme-@xxxxxxxxxxxx> wrote:

John Larkin wrote:

Is there a convention for negative hex numbers?

-0xFEEE

or

0x-ABCD


FFFF is either -1 or 65535 according to whether it is a signed or unsigned quantity

Only if you're using 16-bit ints and decide that they are signed. I
consider 0xFEEE to be decimal +65262. My HP 32S calculator agrees.


To say -FFFF is like saying "I'm going to subtract -1".
Generally if I do this it is with a sense of guilt that I can't be bothered to negate it.

I want "-0x40000000" to program a generator to make -16.000 MHz.

John



.