xsl-list
[Top] [All Lists]

Re: [xsl] Saxon Div Issue

2015-01-19 09:52:23
Mailing Lists Mail daktapaal(_at_)gmail(_dot_)com wrote:
I have a value 9.88 , I use the div  to do an operation

Pseudo code:

var num = 9.88
var result = $num div 100

I expect 0.0988 .. I get 0.09880000000000001

I am using Saxon-EE-9.5.1-5.jar

What is happening?




If you use

  <xsl:variable name="$num" as="xs:decimal" select="9.88"/>

and then do

  $num div 100

the problem should not occur. I suspect you use an xs:double instead, depending on your real code.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>