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

RE: What is the shortest expression converting an xs:

Subject: RE: What is the shortest expression converting an xs:double to xs:integer?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 4 Dec 2004 09:30:51 -0000
converting double to integer
You could use 

11 to (f:sqrt($pNum, 0.1E0) + 0.5) idiv 1

but it's not a great improvement.

I'm trying to remember why round() returns a double - I think it's because
of the problem of numbers that are too large for an xs:integer.

Michael Kay

> -----Original Message-----
> From: Dimtre Novatchev [mailto:dnovatchev@xxxxxxxxx] 
> Sent: 04 December 2004 00:53
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  What is the shortest expression converting an 
> xs:double to xs:integer?
> 
> In my code I had to use this expression:
> 
>     (11 to xs:integer(round(f:sqrt($pNum, 0.1E0))))
> 
> Can it be expressed in a more simple way?
> 
> Cheers,
> Dimitre

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.