RE: [xsl] What is the shortest expression converting an xs:double to xs:integer?

Subject: RE: [xsl] 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
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: [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

Current Thread