Login     Register

        Contact Us     Search

XLeratorDB/math Documentation

SQL Server POWER function


POWER
Update 03 Mar 2017

Use the scalar function POWER to return the value of the specified expression to the specified power. The XLeratorDB POWER function will return a NULL value instead of arithmetic overflow.

Syntax
SELECT [wct].[POWER] (
   <@x, float,>
  ,<@y, float,>)
Arguments
Input NameDescription
@xIs an expression of type float or of a type that can be implicitly converted to float.
@yIs the power to which to raise @x. @y is an expression of type float or of a type that can be implicitly converted to float.
Return Types
float
Remarks
  • If POWER evaluates to > 1.79769313486232E+308 then NULL is returned.
  • If @x < 0 and @y is not an integer then NULL is returned.
  • Available in XLeratorDB / math 2008 only
Examples
SELECT
     x
    ,y
    ,wct.POWER(x,y) as [POWER]
FROM (VALUES
     (2,0)
    ,(2,1023)
    ,(2,1024)
    ,(2,-1075)
    ,(-2,-1075)
    ,(-2,3.5)
    ,(0,0)
    )n(x,y)

This produces the following result.



Copyright 2008-2017 Westclintech LLC         Privacy Policy        Terms of Service