Logo

IMLOG2

Updated 2024-03-13 16:01:20.937000

Syntax

SELECT [westclintech].[wct].[IMLOG2] (
   <@inumber, nvarchar(4000),>)

Description

Use the scalar function IMLOG2 to return the base-2 logarithm of a complex number in x + yi or x + yj text format. The base-2 logarithm of complex function is computed by:

\log_{2}(x+yi)=(\log_{2}e)\ln(x+yi)

Arguments

@inumber

is the value at which to evaluate the function. @inumber is an expression of type varchar or of a type that can be implicitly converted to varchar and must be in the format x + yi or x + yj, where x is a real number that can be converted to float and yi (or yj) is an imaginary number, where the y part can be converted to float.

Return Type

nvarchar(4000)

Remarks

Use COMPLEX to convert real and imaginary coefficients into a complex number.

Examples

select wct.IMLOG2('7+24i');

This produces the following result.

{"columns":[{"field":"column 1"}],"rows":[{"column 1":"4.64385618977471+1.85675171692524i"}]}