[xquery-talk] type of 1.2 div 1.2?
howardk at fatdog.com
Tue Mar 22 16:51:06 PST 2005
Oops, mea culpa. I misread something. I'm looking at galax, and typeswitch
shows that the final result is actually decimal as it should be. What threw
me was an intermediate result, which shows the normalized core
representation for this query as:
Given this, I still don't understand:
(1) why there's an untyped-to-double conversion, since I would have thought
the grammar provided the typing information on the numerics as decimal
(2) even if there are intermediate doubles, how we get from there to a final
> -----Original Message-----
> From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com]On Behalf
> Of Michael Kay
> Sent: Tuesday, March 22, 2005 12:30 PM
> To: howardk at fatdog.com; talk at xquery.com
> Subject: RE: [xquery-talk] type of 1.2 div 1.2?
> The result should definitely be of type xs:decimal.
> There's some debate about whether it's permissible to return a subtype of
> xs:decimal, e.g. xs:integer or my:veryShortInteger; but
> returning xs:double
> is not on.
> (Unless this is actually an XPath processor with 1.0 compatibility mode
> Michael Kay
> > -----Original Message-----
> > From: talk-bounces at xquery.com
> > [mailto:talk-bounces at xquery.com] On Behalf Of Howard Katz
> > Sent: 22 March 2005 18:44
> > To: talk at xquery.com
> > Subject: [xquery-talk] type of 1.2 div 1.2?
> > What's the type and value of the single atomic returned by the query:
> > 1.2 div 1.2
> > I'm looking at different implementations. I see one returning an
> > xsd:decimal, value 1 as a result (my understanding as well).
> > I see another
> > treating the data as untyped and doing two conversions to
> > xsd:double first,
> > again returning a value of 1 but this time of type xsd:double.
> > Which one is correct?
> > Howard
> > _______________________________________________
> > talk at xquery.com
> > http://xquery.com/mailman/listinfo/talk
> talk at xquery.com
More information about the talk