You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "David Reiss (JIRA)" <ji...@apache.org> on 2009/12/09 07:49:19 UTC

[jira] Commented: (THRIFT-644) Doubles are not IEEE 754 when writing in the BinaryFormat

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

David Reiss commented on THRIFT-644:
------------------------------------

Can you give some more information about what Java produces?  Can you also tell us the specific double value that causes it and what $data is?

> 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
> Most likely all OSes 
>            Reporter: Jeff Whiting
>
> 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.