SQL Server IMREAL Function
Updated 2024-02-13 19:26:35.550000
Description
Use the scalar function IMREAL function to return the real coefficient of a complex number in the x + yi or x + yj format.
Syntax
SELECT [westclintech].[wct].[IMREAL] (
<@inumber, nvarchar(4000),>)
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
float
Remarks
Use COMPLEX to convert real and imaginary coefficients into a complex number.
Examples
select wct.IMREAL('7+24i');
This produces the following result.
| column 1 |
|---|
| 7 |
select wct.IMREAL('-i');
This produces the following result.
| column 1 |
|---|
| 0 |
select wct.IMREAL('7');
This produces the following result.
| column 1 |
|---|
| 7 |