You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vxquery.apache.org by "Preston Carman (JIRA)" <ji...@apache.org> on 2012/06/23 03:02:42 UTC

[jira] [Updated] (VXQUERY-36) SubString Review of Double and Integer Parameters

     [ https://issues.apache.org/jira/browse/VXQUERY-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Preston Carman updated VXQUERY-36:
----------------------------------

    Description: 
(Till suggestion) For fn:substring I think that we should keep the possibility to directly consume integer arguments, as this will we the most common case. We only need to insure, that the compiler won't always introduce the promotion to double. 

The handling of double arguments to fn:substring is not correct. Using intValue on the double will truncate the value, while the specification says that it needs to be rounded (http://www.w3.org/TR/xpath-functions/#func-substring). I would propose to leave it as-is for now and to fix it using our implementation for fn:round once that it available. If that's what we do, we should file a bug to ensure that we don't forget it.

  was:The handling of double arguments to fn:substring is not correct. Using intValue on the double will truncate the value, while the specification says that it needs to be rounded (http://www.w3.org/TR/xpath-functions/#func-substring). I would propose to leave it as-is for now and to fix it using our implementation for fn:round once that it available. If that's what we do, we should file a bug to ensure that we don't forget it.


Was missing part of the original comment in the ticket.
                
> SubString Review of Double and Integer Parameters
> -------------------------------------------------
>
>                 Key: VXQUERY-36
>                 URL: https://issues.apache.org/jira/browse/VXQUERY-36
>             Project: VXQuery
>          Issue Type: Bug
>            Reporter: Preston Carman
>
> (Till suggestion) For fn:substring I think that we should keep the possibility to directly consume integer arguments, as this will we the most common case. We only need to insure, that the compiler won't always introduce the promotion to double. 
> The handling of double arguments to fn:substring is not correct. Using intValue on the double will truncate the value, while the specification says that it needs to be rounded (http://www.w3.org/TR/xpath-functions/#func-substring). I would propose to leave it as-is for now and to fix it using our implementation for fn:round once that it available. If that's what we do, we should file a bug to ensure that we don't forget it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira