<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>XML: Typed and Untyped</title><link>http://blogs.msdn.com/b/sqlprogrammability/archive/2006/09/27/773032.aspx</link><description>Occasionally we hear from people who are surprised to find that their XML data uses more space when typed than when untyped. In general, this is to be expected. Typed XML has some advantages over untyped XML, namely smarter query plans and the ability</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: XML: Typed and Untyped</title><link>http://blogs.msdn.com/b/sqlprogrammability/archive/2006/09/27/773032.aspx#1218210</link><pubDate>Wed, 06 Dec 2006 06:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1218210</guid><dc:creator>Mike C#</dc:creator><description>&lt;p&gt;Thanks, my tests were only slightly off from the standard, but now I understand a little better why. &amp;nbsp;Also, the documented range for SQL REAL (in BOL anyway) is -3.40E + 38 to -1.18E-38, 0 and 1.18E-38 to 3.40E+38, which is an even greater deviance than I expected, and that's what was throwing me off. &amp;nbsp;Of course a deviance in the 38th place after the decimal point isn't that big a deal unless you're doing some sort of extremely specialized sub-atomic physics calculations (or trying to calculate your odds in Vegas lol), but I was just wondering if I my calcs were correct. &amp;nbsp;Thanks again!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1218210" width="1" height="1"&gt;</description></item><item><title>re: XML: Typed and Untyped</title><link>http://blogs.msdn.com/b/sqlprogrammability/archive/2006/09/27/773032.aspx#1207259</link><pubDate>Mon, 04 Dec 2006 22:13:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1207259</guid><dc:creator>MSDNArchive</dc:creator><description>&lt;p&gt;Other than a lack of support for NaN, xs:float and xs:double should conform to the IEEE-754 standard, which is what the W3C spec requires:&lt;/p&gt;
&lt;p&gt;&amp;lt;blockquote&amp;gt;The basic value space of float consists of the values m * 2^e, where m is an integer whose absolute value is less than 2^24, and e is an integer between -149 and 104, inclusive.&amp;lt;/blockquote&amp;gt;&lt;/p&gt;
&lt;p&gt;The smallest possible positive float value is 1 * 2^-149, or about 1.401298e-45, and the largest possible finite float value is (2^24 - 1) * 2^104, or about 3.4028237e+38.&lt;/p&gt;
&lt;p&gt;Are you saying that the range is only slightly different from what you expected (i.e., at the sixth or seventh decimal place), or did you expect something radically different (e.g., 1.0e-149 to 9.99999e104)?&lt;/p&gt;
&lt;p&gt;SQL REAL also conforms to the IEEE-754 standard with a few limitations, namely that it doesn't support NaN or +/-INF. It also has limited support for denormalized values (those with an absolute value less than about 1.1754944e−38), which is why xs:float appears to have a greater range than REAL. You can't assign the literal value 1.401298E-45 to a REAL variable, but you can get there with something like this:&lt;/p&gt;
&lt;p&gt;&amp;lt;blockquote&amp;gt;declare @r real&lt;/p&gt;
&lt;p&gt;set @r = 1.401298E-37&lt;/p&gt;
&lt;p&gt;set @r = @r / 100000000&lt;/p&gt;
&lt;p&gt;select @r&amp;lt;/blockquote&amp;gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1207259" width="1" height="1"&gt;</description></item><item><title>re: XML: Typed and Untyped</title><link>http://blogs.msdn.com/b/sqlprogrammability/archive/2006/09/27/773032.aspx#1200436</link><pubDate>Sun, 03 Dec 2006 19:56:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1200436</guid><dc:creator>Mike C#</dc:creator><description>&lt;p&gt;Quick question - I can't find documentation on the ranges for SQL 2K5 XQuery xs:float and xs:double data types. It appears the xs:float range might be different from the W3C spec and also different from the SQL REAL data type. I've come up with -3.4E+38 to -1.401298E-45, 0,&lt;/p&gt;
&lt;p&gt;+1.401298E-45 to +3.4E+38 for xs:float (still working on xs:double.) Is this correct?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1200436" width="1" height="1"&gt;</description></item></channel></rss>