Login     Register

        Contact Us     Search

XLeratorDB/engineering Online Documentation

SQL Server COMPLEX function


 
Updated: 27 August 2010

Use COMPLEX to convert real and imaginary coefficients into a complex number of the form x + yi or x + yj.
Syntax
SELECT [wctEngineering].[wct].[COMPLEX] (
   <@Real_num, float,>
 ,<@i_num, float,>
 ,<@Suffix, nvarchar(4000),>)
Arguments
@Real_num
is the real coefficient of the complex number. @Real_num is an expression of type float or of a type that can be implicitly converted to float.
@i_num
is the imaginary coefficient of the complex number. @i_num is an expression of type float or of a type that can be implicitly converted to float.
@Suffix
is the suffix for the imaginary component of the complex number. If omitted, @suffix is assumed to be "i".
Return Types
varchar(4000)
Remarks
·         if @Suffix is entered and is not “i” or “j”, COMPLEX returns an error.
Examples

select
wct.COMPLEX(3,4, NULL)


This produces the following result

-------------------------------

3+4i
 
(1 row(s) affected)


select
wct.COMPLEX(3,4, 'j')

This produces the following result
-------------------------------
3+4j
 
(1 row(s) affected)


select
wct.COMPLEX(0,1,NULL)

This produces the following result
--------------------------------
i
 
(1 row(s) affected)


select
wct.COMPLEX(1,0,NULL)

This produces the following result
---------------------------------
1
 

(1 row(s) affected)



Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service