[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Saxon Div Issue

Subject: Re: Saxon Div Issue
From: "G. Ken Holman g.ken.holman@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Jan 2015 16:27:32 -0000
Re:  Saxon Div Issue
Dak, in the response below you are misunderstanding our use of the terminology. We are talking about the representation of the number internally in memory, we are not talking about whether the element or the attribute is a number or not a number. We are not talking about radix. We are talking about internal representation.

As Martin says, the numeric value of an element or an attribute is represented in memory as a double-length binary value unless you tell it differently. If you are using XSLT 2.0 you can tell the processor to treat it differently in memory by casting the element or attribute value into a decimal representation internally.

Then, when you do arithmetic with decimal representations of values, the result is a clean decimal result. There is no loss of detail as when happens when
using binary.


So, in your pseudo code below, you do know that it will be a double-length binary value because you have not cast it to be anything else. Radix has nothing to do with this discussion.

I hope this helps.

. . . . . Ken

At 2015-01-19 16:06 +0000, Mailing Lists Mail daktapaal@xxxxxxxxx wrote:
>I wouldn't know if it will be a double that I will be a decimal.
Ignore the above inebriated statement.. All I meant was, I wouldnt
know if it will be a decimal.


On Mon, Jan 19, 2015 at 11:03 AM, Mailing Lists Mail daktapaal@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote: > THe problem is , I dont know what will come in the $num. It is an > xpath. It comes from an XML element. > > SO sometimes, the element contains 988, and sometimes it contains 98.8 > .. so my pseudo code actually is :" > > $num = /xpath/num > var result = $num div 100 > > I wouldn't know if it will be a double that I will be a decimal. > > Dak



-- Check our site for free XML, XSLT, XSL-FO and UBL developer resources | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/video.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: http://plus.google.com/+GKenHolman-Crane/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |


--- This email has been checked for viruses by Avast antivirus software. http://www.avast.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.