[ 
https://issues.apache.org/jira/browse/THRIFT-644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12788977#action_12788977
 ] 

Jeff Whiting commented on THRIFT-644:
-------------------------------------

The tests run fine.  

We found our problem though.  After writing the file to disk in php we were 
reading from the disk into a string in Java and then attempting to deserialize 
it.  Obviously putting binary data into a Java string mangles the binary data.

Sorry for submitting a bogus bug and thanks for replying.   

> Doubles are not IEEE 754 when writing in the BinaryFormat
> ---------------------------------------------------------
>
>                 Key: THRIFT-644
>                 URL: https://issues.apache.org/jira/browse/THRIFT-644
>             Project: Thrift
>          Issue Type: Bug
>          Components: Compiler (PHP)
>    Affects Versions: 0.1, 0.2, 0.3
>         Environment: PHP 5.3 - Ubuntu 9.10 - 32 bit
> Most likely all OSes 
>            Reporter: Jeff Whiting
>         Attachments: Timing.thrift
>
>
> Steps to Repro:
> 1.  Without the PHP thrift extension serialize a struct with a double (note I 
> haven't tested this with the php extension)
> 2. Attempt to read the struct using Java
> Results:
> Java is unable to read the double correctly
> Expected Results:
> Looking at the PHP code in TBinaryProtocol.php the function writeDouble does 
> the following:
> $data = pack('d', $value); 
> According to the PHP documentation 
> (http://php.net/manual/en/function.pack.php)
> 'd' is: double (machine dependent size and representation).
> The double should be IEEE 754 compliant.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to