[ 
https://wso2.org/jira/browse/MASHUP-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17110#action_17110
 ] 

Keith Godwin Chapman commented on MASHUP-816:
---------------------------------------------

This looks to be something we cannot overide. If the user uses correct 
annotations we do take care of it. for e.g

toString.inputTypes = { "input": "xs:float"};
toString.outputType = "string"; /* TODO: Add output type here */  
   function toString(input)
   {
      return input; 
   }

toString2.inputTypes = { "more":"xs:double" };
toString2.outputType = "string"; /* TODO: Add output type here */  
   function toString2( more)
   {
      return more; 
   }

toString3.inputTypes = { "input": "xs:float", "more":"xs:double" };
toString3.outputType = "string"; /* TODO: Add output type here */  
   function toString3(input, more)
   {
      return "As a float:" + input + ", as a double: " + more; 
   }


invoking  toString with 1.2345 produces 1.2345
invoking  toString2 with 1.2345 produces 1.2345

Its only when the float is concatenated with a string that we see this behavior 
and it happens inside Rhino. nothing we can do about it.

> Strange behavior between floats and doubles
> -------------------------------------------
>
>                 Key: MASHUP-816
>                 URL: https://wso2.org/jira/browse/MASHUP-816
>             Project: WSO2 Mashup Server
>          Issue Type: Bug
>            Reporter: Jonathan Marsh
>            Assignee: Keith Godwin Chapman
>             Fix For: 1.1
>
>
> Test:
>    toString.inputTypes = { "input": "xs:float", "more":"xs:double" };
>     toString.outputType = "string"; /* TODO: Add output type here */  
>    function toString(input, more)
>    {
>       return "As a float:" + input + ", as a double: " + more; 
>    }
> with the values "1.2345", "1.2345".
> Result:
>   As a float:1.2345000505447388, as a double: 1.2345.
> Just checking that this indeed is the expected amount of float "noise" and 
> we're not introducing more...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to