phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-1814) Handle e notation for defining float/double
Date Tue, 14 Apr 2015 21:48:58 GMT

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

ASF GitHub Bot commented on PHOENIX-1814:
-----------------------------------------

Github user JamesRTaylor commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/67#discussion_r28374287
  
    --- Diff: phoenix-core/src/main/antlr3/PhoenixSQL.g ---
    @@ -967,9 +967,14 @@ NUMBER
         :   POSINTEGER
         ;
     
    -// Exponential format is not supported.
     DECIMAL
    --- End diff --
    
    I don't think any new methods in ParseNodeFactory will be necessary, as you can use the
factory.literal(Object o) method and if the Object is an instanceof Double, it'll do the right
thing. You will need the grammar change, but just create a new top level rule for it instead
of adding it to DECIMAL. When it matches, you can do something like this:
    
        $ret = factory.literal(Double.valueOf(token.getText()));


> Handle e notation for defining float/double
> -------------------------------------------
>
>                 Key: PHOENIX-1814
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1814
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: Brian Esserlieu
>              Labels: Newbie
>
> We should allow a numeric literal to be defined with e notation for a float/double like
this: 
> {code}
> +1.5e-7
> 12E-5
> -.12345e+6789
> {code}



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

Mime
View raw message