[mashup-dev] [jira] Resolved: (MASHUP-816) Strange behavior between
floats and doubles
Keith Godwin Chapman (JIRA)
jira at wso2.org
Wed Jun 4 03:46:40 PDT 2008
[ https://wso2.org/jira/browse/MASHUP-816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Keith Godwin Chapman resolved MASHUP-816.
-----------------------------------------
Resolution: Fixed
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
More information about the Mashup-dev
mailing list