Updated: 27 August 2010
Use IMPRODUCT_q to return the product of a dataset containing complex numbers in x + yi or x + yj text format. The product of 2 complex numbers is computed as:
Syntax
SELECT [wctEngineering].[wct].[IMPRODUCT_q] (
<@IMValues_RangeQuery, nvarchar(4000),>)
Arguments
@IMValues_RangeQuery
the select statement, as text, used to determine the complex numbers to be used in the IMPRODUCT_q calculation.
Return Types
varchar(4000)
Remarks
· Use COMPLEX to convert real and imaginary coefficients into a complex number.
· For more simpler queries consider using the IMPRODUCT function.
Examples
create table #p1 (inumber varchar(50))
insert into #p1 values ('2+i')
insert into #p1 values ('2-i')
insert into #p1 values ('3+2i')
insert into #p1 values ('3-2i')
select wct.improduct_q('select inumber from #p1')
This produces the following result
-------------------------
65
(1 row(s) affected)
select wct.IMMULT(wct.IMMULT('2+i','2-i'), wct.IMMULT('3+2i','3-2i'))
This produces the following result
-------------------------
65
(1 row(s) affected)