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

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

I'll try to run the tests today and get back to you.

The funny thing was that Java wasn't giving an error--it would abruptly stop 
reading the binary format.  We have a container struct that has a map of 
Timing.thrift structs as well maps of other structs without doubles.  Once the 
java reader got to a struct that has a double in it would stop reading any 
structs after it.  As soon as we changed the double to an i32 or a string the 
java program would read all of the structs.  It was because of this that I 
assumed there was a problem with the double encoding in php.



> 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