W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2002

RE: F&O comments on substring

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Thu, 21 Nov 2002 06:18:00 -0800
Message-ID: <E5B814702B65CB4DA51644580E4853FB03DA765A@red-msg-12.redmond.corp.microsoft.com>
To: "Kay, Michael" <Michael.Kay@softwareag.com>, "Priscilla Walmsley" <priscilla@walmsley.com>, <public-qt-comments@w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:13:58 GMT