RE: another issue with min/max functions

Xavier:
Thank for your comment! We have rewritten the text for these functions
and the code snippet you referred to is now gone!  The result should be
xs:double.  Please take a look at the descriptions of these functions in
the next version of the document and let us know if you have any
concerns.

All the best, Ashok

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Xavier Franc
> Sent: Saturday, October 11, 2003 4:57 PM
> To: public-qt-comments@w3.org
> Subject: another issue with min/max functions
> 
> 
> in XQuery 1.0 and XPath 2.0 Functions and Operators   15.3.2 & 15.3.3,
> 
> it seems there is a contradiction in typing rules for functions min &
max:
> (correct me if I am wrong)
> 
> between
> 
> "For numeric values, the numeric promotion rules defined in 6.2
Operators
> on Numeric
> Values are used to promote all values to a single common type."
> 
> and
> 
> "The value returned by fn:min($srcval) is equivalent to the value
returned
> by the
>   following XQuery expression.
> 
>        let $ordered-vals :=
>          for $val in $srcval
>          where $val ne $val
>          order by $val
>          return $val
>        return $ordered-vals[1]
> "
> 
> If one considers the following expression: max( (2e0 , 2.1) )
> the second rule (sort) yields a value (2.1) of type xs:decimal,
> while the promotion rules imply a xs:double result type.
> 
> The formal semantics don't help much...
> BTW the section 6.2.8 puts together
> the fn:min fn:max, fn:avg, and fn:sum functions
> as if fn:min & fn:max were only numeric functions,
> but nothing is said about their other variants.
> 
> 
> 
> --
> Xavier FRANC
> 

Received on Sunday, 12 October 2003 14:14:40 UTC