Subject: RE: [xsl] Floating point precision error From: Jim Melton <jim.melton@xxxxxxx> Date: Thu, 26 Jan 2006 18:19:43 -0700 |
At 1/26/2006 05:45 PM, Michael Kay wrote: > > > > > Michael, if you don't mind me asking, how do you explicitly > > set the precision? It's not something to do with xs:float() and > > xs:double() is it? I tried them out but it seems they're not > > supported. > >XSLT 2.0 allows you to use xs:float(...) to get a value as a single >precision floating point number. (Why anyone wants to use 32-bit floats in >the 21st century is beyond me, but they're in XSLT because they're in schema >and they're in schema because they're in SQL...)
Oh, no, they're not "in SQL". The SQL standard says nothing about how many bits or digits there are in any of its numeric types. Here is the entire definition of SQL's approximate numeric types (as they are called):
26) FLOAT specifies the data type approximate numeric, with binary precision equal to or greater than the value of the specified <precision>. The maximum value of <precision> is implementation-defined. <precision> shall not be greater than this value.
27) REAL specifies the data type approximate numeric, with implementation-defined precision.
28) DOUBLE PRECISION specifies the data type approximate numeric, with implementation-defined precision that is greater than the implementation-defined precision of REAL.
29) For the <approximate numeric type>s FLOAT, REAL, and DOUBLE PRECISION, the maximum and minimum values of the exponent are implementation-defined.
Hope this helps, Jim
> > > > Oh and as I mentioned, I only got this on SunOS. Would it have > > something to do with the OS? > >You'll have to ask the Xalan folks about that. > >Michael Kay >http://www.saxonica.com/
======================================================================== Jim Melton --- Editor of ISO/IEC 9075-* (SQL) Phone: +1.801.942.0144 Co-Chair, W3C XML Query WG; F&O (etc.) editor Fax : +1.801.942.3345 Oracle Corporation Oracle Email: jim dot melton at oracle dot com 1930 Viscounti Drive Standards email: jim dot melton at acm dot org Sandy, UT 84093-1063 USA Personal email: jim at melton dot name ======================================================================== = Facts are facts. But any opinions expressed are the opinions = = only of myself and may or may not reflect the opinions of anybody = = else with whom I may or may not have discussed the issues at hand. = ======================================================================== --=====================_1576168480==.ALT--
======================================================================== Jim Melton --- Editor of ISO/IEC 9075-* (SQL) Phone: +1.801.942.0144 Co-Chair, W3C XML Query WG; F&O (etc.) editor Fax : +1.801.942.3345 Oracle Corporation Oracle Email: jim dot melton at oracle dot com 1930 Viscounti Drive Standards email: jim dot melton at acm dot org Sandy, UT 84093-1063 USA Personal email: jim at melton dot name ======================================================================== = Facts are facts. But any opinions expressed are the opinions = = only of myself and may or may not reflect the opinions of anybody = = else with whom I may or may not have discussed the issues at hand. = ========================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Floating point precision , Michael Kay | Thread | [xsl] The f:sqrt() and stdDev() fun, Dimitre Novatchev |
Re: [xsl] Shallow copy and base URI, Florent Georges | Date | [xsl] How might I reproduce a tag, , footh |
Month |