On Mon, Jan 19, 2009 at 08:21:00AM +0000, Phillip Oldham wrote:
> I'm not doing any conversion of types as far as I know. Defining the  
> attr as a double in thrift, then in python:
> 
> p = Price()
> p.total = 0.9
> client.setPrice(p)
> 
> And for the server:
> def setPrice(self, p):
>   print p
> 
> And I get an output of 0.90000002

It's not actually a problem in Thrift. As Ted pointed out, there's no
exact representation for floats in base 2. For example:

python -c "f = 0.9; print repr(f)"

gives 0.90000000000000002 here.

Cheers.

Reply via email to