Re: negative hex
- From: Spehro Pefhany <speffSNIP@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 29 Jun 2008 13:49:12 -0400
On Sun, 29 Jun 2008 09:47:04 -0700, the renowned John Larkin
<jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On Sat, 28 Jun 2008 22:33:33 -0700, Tom2000 <abuse@xxxxxxxxxxxx>
wrote:
On Sat, 28 Jun 2008 19:16:36 -0700, John Larkin
<jjlarkin@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
So, ten is the only radix in which negative numbers can be expressed?
Then it's sure a piece of luck that we evolved ten fingers, otherwise
we'd be stuck working with only positive numbers.
John
Well, it's your program, so you can write it any way you please.
Me? Well, I figure that I'll have to go back to my code in a year or
three to do some maintenance and enhancement. So I write it as
clearly and cleanly as possible, following convention.
If I do something unusual, I comment it carefully so I'll know what I
did and why I did it.
But feel free to write any way you please. I won't the be guy stuck
maintaining your code.
Somewhere along the line, though, you'll probably figure out that it's
best to follow convention and common sense.
Tom
OK, what's the convention for expressing negative numbers, as parsable
ascii strings, in base 16? That was, after all, my original question.
John
AFAIK, the convention is not to do it. But if you must, I don't seen
anthing wrong with something like -0x100. After all, we commonly use
the unary 1's complement '~' simiarly as in ~0x100. The '-' symbol is
somewhat more troublesome to parse because it's used as both a binary
operator and a unary operator, but you know that.
That said, I can't think of a single case where I'd really want to use
(or see) signed hex numbers.
Best regards,
Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
speff@xxxxxxxxxxxx Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
.
- References:
- negative hex
- From: John Larkin
- Re: negative hex
- From: Tom2000
- Re: negative hex
- From: John Larkin
- Re: negative hex
- From: Tom2000
- Re: negative hex
- From: John Larkin
- negative hex
- Prev by Date: Re: negative hex
- Next by Date: Re: Intel rejects Vista, will stay with XP and wait for windows7
- Previous by thread: Re: negative hex
- Next by thread: Re: negative hex
- Index(es):
Relevant Pages
|