Re: efficient two's complement of a byte array
- From: darthghandi@xxxxxxxxx
- Date: 20 Feb 2007 20:25:50 -0800
On Feb 17, 12:16 am, darthgha...@xxxxxxxxx wrote:
On Feb 16, 11:44 pm, "Bruce Wood" <brucew...@xxxxxxxxxx> wrote:
On Feb 16, 8:54 pm, darthgha...@xxxxxxxxx wrote:
So what you are all saying is that there is no easy way to get a two's
complement of a byte array? That sucks. I guess that's Microsoft's
gift to me?
I don't know if it's particularly _Microsoft's_ gift to you. More like
the modern Intel processor's gift to you. In fact, I don't think I've
ever worked on a language or a processor in which something as obscure
as taking the two's-complement of a byte array was optimized into some
special instruction or operation.
There's certainly an _easy_ way to do it: loop through the bytes and
take the two's complement of each one. That's pretty darned easy.
However, what you asked for was _faster_. As I said, I've never seen a
_fast_, short-cut way to do that, on any platform, on any chip.
Perhaps others with wider experience have, but not me.
Thanks for the response. That was the way I was hoping to avoid.
Looks like it's the best bet.
Thanks again for the time.
Chris
Looks like the newest version of Visual Studio will come with a
BigInteger class that I could use. It doesn't support bitwise right
now, but may be they will add it later.
Here's where I saw that:
http://blogs.msdn.com/bclteam/archive/2007/01/16/introducing-system-numeric-biginteger-inbar-gazit.aspx
.
- Follow-Ups:
- Re: efficient two's complement of a byte array
- From: Bruce Wood
- Re: efficient two's complement of a byte array
- References:
- efficient two's complement of a byte array
- From: darthghandi
- Re: efficient two's complement of a byte array
- From: Arne Vajhøj
- Re: efficient two's complement of a byte array
- From: darthghandi
- Re: efficient two's complement of a byte array
- From: Bruce Wood
- Re: efficient two's complement of a byte array
- From: Ben Voigt
- Re: efficient two's complement of a byte array
- From: Arne Vajhøj
- Re: efficient two's complement of a byte array
- From: Ben Voigt
- Re: efficient two's complement of a byte array
- From: darthghandi
- Re: efficient two's complement of a byte array
- From: Bruce Wood
- Re: efficient two's complement of a byte array
- From: darthghandi
- efficient two's complement of a byte array
- Prev by Date: Re: Only allow one checked checkbox in a collection
- Next by Date: Re: polymorphism/boxing question
- Previous by thread: Re: efficient two's complement of a byte array
- Next by thread: Re: efficient two's complement of a byte array
- Index(es):
Relevant Pages
|