Re: negative hex



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
.



Relevant Pages

  • Re: negative hex
    ... Then it's sure a piece of luck that we evolved ten fingers, ... we'd be stuck working with only positive numbers. ... following convention. ... OK, what's the convention for expressing negative numbers, as parsable ...
    (sci.electronics.design)
  • Re: Proof 0.999... is not equal to one.
    ... the degree to which the entity I am expressing, that is in no way a ... convention, no matter how much I attempt to disown that convention and ... state that my proof is not trying to contradict the truths within the ...
    (sci.math)
  • Re: Calculator wrong
    ... > Should a teacher accept that as the answer when a pupil insists on following ... > the opposite convention ... By my logic, McCarthy should have been allowed to invent LISP, ... There are many dozens of different ways of expressing an arithmetic ...
    (sci.math)
  • Re: Newbie: How to extract year from a Date object
    ... with a little common sense one can establish ... >by your convention; by the convention many use possibly. ... >> longer than a dragon fly: ... >> IMO a smattering of Hungarian is useful, but excessive use of it makes ...
    (microsoft.public.vb.general.discussion)
  • Re: Newbie: How to extract year from a Date object
    ... with a little common sense one can establish ... by your convention; by the convention many use possibly. ... The tradeoff in being able to see the data type ... > Similarly P is a dragonfly pointer but pStart is significant ...
    (microsoft.public.vb.general.discussion)