incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laing, Michael" <michael.la...@nytimes.com>
Subject Re: CQL decimal encoding
Date Wed, 26 Feb 2014 12:10:52 GMT
go uses 'zig-zag' encoding, perhaps that is the difference?


On Wed, Feb 26, 2014 at 6:52 AM, Peter Lin <woolfel@gmail.com> wrote:

>
> You may need to bit shift if that is the case
>
> Sent from my iPhone
>
> > On Feb 26, 2014, at 2:53 AM, Ben Hood <0x6e6562@gmail.com> wrote:
> >
> > Hey Colin,
> >
> >> On Tue, Feb 25, 2014 at 10:26 PM, Colin Blower <cblower@barracuda.com>
> wrote:
> >> It looks like you are trying to implement the Decimal type. You might
> want
> >> to start with implementing the Integer type. The Decimal type follows
> pretty
> >> easily from the Integer type.
> >>
> >> For example:
> >> i = unmarchalInteger(data[4:])
> >> s = decInt(data[0:4])
> >> out = inf.newDec(i, s)
> >
> > Thanks for the suggestion.
> >
> > This is pretty much what I've got already. I think the issue might be
> > to do with the way that big.Int doesn't appear to use two's complement
> > to encode the varint. Maybe what is happening is that the encoding is
> > isomorphic across say Java, .NET, Python and Ruby, but that the
> > big.Int library in Go is not encoding in the same way.
> >
> > Cheers,
> >
> > Ben
>

Mime
View raw message