RE: F&O comments on substring

OK.  Will do!

All the best, Ashok

-----Original Message-----
From: Kay, Michael [mailto:Michael.Kay@softwareag.com] 
Sent: Thursday, November 21, 2002 6:01 AM
To: Priscilla Walmsley; public-qt-comments@w3.org
Subject: RE: F&O comments on substring


> 
> 
> A comment on the substring function:
> 
> I think the 3rd example is incorrect.  -INF + 3 is still 
> -INF, so wouldn't it return ""?
> 
> Thanks,
> Priscilla
> 

yes, you are right.

There is another error here as well: -INF is not a representation of
minus
infinity. It should be written

  fn:double("-INF")
or
  -1 div 0

(Ashok, why not simply revert to the XPath 1.0 examples?)


I've just been checking the formula, which is written as:

 fn:round($startingLoc) <= $p < fn:round($startingLoc +
fn:round($length))  

whereas XPath 1.0 uses the simpler:

 fn:round($startingLoc) <= $p < fn:round($startingLoc) +
fn:round($length)

I think they're equivalent, but to avoid the effort of proving it, I
think
it would be better to use the latter (which is more efficient because
the
$startingLoc only needs to be rounded once).

Michael Kay   

Received on Thursday, 21 November 2002 09:18:32 UTC