RWalib C Array Library User Guide > Type Conversion > cmplxflt
  

cmplxflt
Returns a single-precision complex number for two real inputs. The PV-WAVE API for this routine is the COMPLEX Function.
Prototype
COMPLEX cmplxflt( float r, float i )
Parameters
r — (Input) The real part of the complex number.
i — (Input) The imaginary part of the complex number.
Return value
The single-precision complex number (r,i).
Example
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "alib.h"
void main() {
    COMPLEX c;
    alibinit( NULL, NULL, NULL, NULL );
    c = cmplxflt( 1, 2 );
    alibPrintArrayc( 1, 1, 1, 1, &c, NULL );
}
 
Output:
 
(    1.0e+00    2.0e+00 )

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.