﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / SQL Server 2005 General Discussion  / Bug in POWER  function? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 05:01:52 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Bug in POWER  function?</title><link>http://www.sqlservercentral.com/Forums/Topic1064529-149-1.aspx</link><description>POWER relies on a FLOAT conversion which, IIRC, has a maximum precision of 15 digits.  Here's an article that demonstrates the problem for another function that does a FLOAT conversion...[code="sql"]http://www.sqlservercentral.com/articles/T-SQL/71565/[/code]</description><pubDate>Tue, 15 Feb 2011 16:08:25 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: Bug in POWER  function?</title><link>http://www.sqlservercentral.com/Forums/Topic1064529-149-1.aspx</link><description>It's probably a floating point issue.  It looks like you're using floating point numbers (they have decimal places), instead of integers.  Shouldn't affect whole-number calculations, but it may in this kind of case.</description><pubDate>Tue, 15 Feb 2011 14:14:42 GMT</pubDate><dc:creator>GSquared</dc:creator></item><item><title>Bug in POWER  function?</title><link>http://www.sqlservercentral.com/Forums/Topic1064529-149-1.aspx</link><description>I was just trying to load up the largest BIGINT, 9,223,372,036,854,775,807, by using the POWER function (2^63) - 1.  When plugging in "2 raised to the 63," the returned value is 9,223,372,036,854,775,800 and not 9,223,372,036,854,775,808 as I would expect (prior subtracting 1 to get the largest allowed BIGINT).   SELECT POWER(2., 63.) - 1.When obtaining the largest INT value by raising to the power of 31, I get the expected results.   SELECT POWER(2., 31.) - 1.This a known issue?</description><pubDate>Tue, 15 Feb 2011 13:21:01 GMT</pubDate><dc:creator>jon-230788</dc:creator></item></channel></rss>