"Infinity" is incorrectly cast to xs:float.
Hi,
I have found the following behaviour in BaseX 9.0:
"Infinity" cast as xs:float (: INF :) "-Infinity" cast as xs:float (: -INF :) "infinity" cast as xs:float (: [FORG0001] Cannot convert xs:string to xs:float: "infinity". :) "Infinity" cast as xs:double (: [FORG0001] Cannot convert xs:string to xs:double: "Infinity". :) "-Infinity" cast as xs:double (: [FORG0001] Cannot convert xs:string to xs:double: "-Infinity". :)
From my reading of Functions and Operators 3.1, and XML Schema 1.1 Part 2 Datatypes, "Infinity" and "-Infinity" are both invalid values for xs:float (like with xs:double) -- they should only be "INF" and "-INF".
Kind regards, Reece H. Dunn
Dear Reece,
Thanks for the hint. An updated snapshot will be available tomorrow [1].
Best, Christian
Quoted text · Reece Dunn · 16 lines
On Sat, Jun 23, 2018 at 3:53 PM Reece Dunn <msclrhd at googlemail.com> wrote: > > Hi, > > I have found the following behaviour in BaseX 9.0: > > "Infinity" cast as xs:float (: INF :) > "-Infinity" cast as xs:float (: -INF :) > "infinity" cast as xs:float (: [FORG0001] Cannot convert xs:string to xs:float: "infinity". :) > "Infinity" cast as xs:double (: [FORG0001] Cannot convert xs:string to xs:double: "Infinity". :) > "-Infinity" cast as xs:double (: [FORG0001] Cannot convert xs:string to xs:double: "-Infinity". :) > > From my reading of Functions and Operators 3.1, and XML Schema 1.1 Part 2 Datatypes, "Infinity" and "-Infinity" are both invalid values for xs:float (like with xs:double) -- they should only be "INF" and "-INF". > > Kind regards, > Reece H. Dunn
Written for BaseX 9.0. BaseX may have changed since: please check the current documentation.