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(_at_)gmail(_dot_)com]
Sent: 04 December 2004 00:53
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--