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

David Nadlinger commented on THRIFT-2775:
-----------------------------------------

@Konrad: It is quite possible to write a floating point formatting algorithm 
that doesn't make those mistakes. However, that was not my intention here, as 
evidenced by the comment in the code. ctfeToString is only used for the 
experimental idlgen feature which generates IDL from D types (i.e., the other 
way round than usual).

Eventually, we will want to ship a CTFE-able floating point formatting routine 
in the D standard library. I don't think it is worth the effort to fix this in 
Thrift before that. Just remove the 3.1415 test, or replace it with a number 
that works.

Interestingly, though, the test definitely passed on x86 and x86_64 half a year 
ago or so. Apparently, there has been a change to how extra precision is 
handled in CTFE or something along the lines. 

> static assert fails in src/thrift/internal/ctfe.d
> -------------------------------------------------
>
>                 Key: THRIFT-2775
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2775
>             Project: Thrift
>          Issue Type: Bug
>          Components: D - Library
>    Affects Versions: 0.9.2
>         Environment: openSUSE 13.1 (i586)  
> DMD Compiler v2.066.0 
> german locale
>            Reporter: Jens Geyer
>         Attachments: THRIFT-2775_ctfe_assert_fail.patch
>
>
> make check in d/lib fails with 
> {code}
> src/thrift/internal/ctfe.d(94): Error: static assert  (ctfeToString(3.1415) 
> == "3.1415") is false
> {code}
> because ctfeToString(3.1415) evaluates to "3.14149999999999"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to