thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yingbo Miao <yin...@thoora.com>
Subject Re: uint64_t
Date Tue, 16 Jun 2009 14:51:24 GMT
In C++, you can cast uint64_t to int64_t and cast back. Data won't be  
lost, since both are 64-bits. e.g.

     uint64_t ui = 0xFFFFFFFFFFFFFFFF;
     cout << "ui=" << ui << endl;    int64_t ii= ui;
     cout << "ii=" << ii << endl;
     uint64_t ui2= ii;
     cout << "ui2=" << ui2 << endl;

and the outputs are:
     ui=18446744073709551615
     ii=-1
     ui2=18446744073709551615



--Yingbo

On Jun 16, 2009, at 6:36 AM, Ephraim Dan wrote:

> We have some big numbers, that we use "unsigned long  
> long" (uint64_t) for in our code.
> Thrift apparently explicitly doesn't support unsigned integer types.
> What are we to do if we do, after all, need to transport such a  
> number using thrift?
>
> Thanks
> --edan


Mime
View raw message