Thanks.

Yeah, it turns out that's what I've done in the past.  This issue seems to
keep catching me as I expect fixed point arithmetic and a lot of my
latitude/longitude calculations end up being exact (e.g. 180 div 2.5).

Why not use a fixed point library rather than convert to xs:double ?  I
don't expect xs:decimal to be efficient--just exact.

On Wed, Mar 20, 2013 at 4:03 PM, Danny Sokolsky <
[email protected]> wrote:

>  It does seem odd—I filed a bug on the MarkLogic side and we’ll take a
> look.  ****
>
> ** **
>
> In the mean time, as David pointed out, casting it to a double seems to
> work around it.****
>
> ** **
>
> -Danny****
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Alex Milowski
> *Sent:* Wednesday, March 20, 2013 9:53 AM
>
> *To:* MarkLogic Developer Discussion
> *Subject:* Re: [MarkLogic Dev General] Simple Math Issue****
>
>  ** **
>
>
> Testing other XQuery processors (e.g. Saxon 9.4 via XProc):****
>
>  ** **
>
> <?xml version="1.0" encoding="UTF-8"?>
> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc";
>    xmlns:c="http://www.w3.org/ns/xproc-step"; version="1.0">
>    <p:output port="result"/>
>    <p:xquery>
>       <p:input port="source">
>          <p:empty/>
>       </p:input>
>       <p:input port="parameters">
>          <p:empty/>
>       </p:input>
>       <p:input port="query">
>          <p:inline>
>             <c:query>
>                element result { 180 div 2.5, 5 div 2.5 }
>             </c:query>
>          </p:inline>
>       </p:input>
>    </p:xquery>
> </p:declare-step>****
>
> Output: <result>72 2</result>****
>
> MarkLogic: <result>71.99999999999999601 1.999999999999999889</result>****
>
> ** **
>
> ** **
>
> --
> --Alex Milowski
> "The excellence of grammar as a guide is proportional to the paucity of the
> inflexions, i.e. to the degree of analysis effected by the language
> considered."
>
> Bertrand Russell in a footnote of Principles of Mathematics ****
>
> _______________________________________________
> General mailing list
> [email protected]
> http://developer.marklogic.com/mailman/listinfo/general
>
>


-- 
--Alex Milowski
"The excellence of grammar as a guide is proportional to the paucity of the
inflexions, i.e. to the degree of analysis effected by the language
considered."

Bertrand Russell in a footnote of Principles of Mathematics
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to