Usage
#include "stdlib/complex/float32/ctor.h"
stdlib_complex64_t
An opaque type definition for a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f );
stdlib_complex64_parts_t
An opaque type definition for a union for accessing the real and imaginary parts of a single-precision complex floating-point number.
float realf( const stdlib_complex64_t z ) {
stdlib_complex64_parts_t v;
v.value = z;
float re = v.parts[ 0 ];
return re;
}
stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f );
float re = realf( z );
The union has the following members:
stdlib_complex64( real, imag )
Returns a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64( 5.0f, 2.0f );
The function accepts the following arguments:
- real:
[in] float
real component. - imag:
[in] float
imaginary component.
stdlib_complex64_t stdlib_complex64( const float real, const float imag );
stdlib_complex64_from_float32( real )
Converts a single-precision floating-point number to a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64_from_float32( 5.0f );
The function accepts the following arguments:
- real:
[in] float
real component.
stdlib_complex64_t stdlib_complex64_from_float32( const float real );
stdlib_complex64_from_float64( real )
Converts a double-precision floating-point number to a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64_from_float64( 5.0 );
The function accepts the following arguments:
- real:
[in] double
real component.
stdlib_complex64_t stdlib_complex64_from_float64( const double real );
stdlib_complex64_from_complex64( z )
Converts (copies) a single-precision complex floating-point number to a single-precision complex floating-point number.
stdlib_complex64_t z1 = stdlib_complex64( 5.0f, 3.0f );
stdlib_complex64_t z2 = stdlib_complex64_from_complex64( z1 );
The function accepts the following arguments:
- z:
[in] stdlib_complex64_t
single-precision complex floating-point number.
stdlib_complex64_t stdlib_complex64_from_complex64( const stdlib_complex64_t z );
stdlib_complex64_from_int8( real )
Converts a signed 8-bit integer to a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64_from_int8( 5 );
The function accepts the following arguments:
- real:
[in] int8_t
real component.
stdlib_complex64_t stdlib_complex64_from_int8( const int8_t real );
stdlib_complex64_from_uint8( real )
Converts an unsigned 8-bit integer to a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64_from_uint8( 5 );
The function accepts the following arguments:
- real:
[in] uint8_t
real component.
stdlib_complex64_t stdlib_complex64_from_uint8( const uint8_t real );
stdlib_complex64_from_int16( real )
Converts a signed 16-bit integer to a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64_from_int16( 5 );
The function accepts the following arguments:
- real:
[in] int16_t
real component.
stdlib_complex64_t stdlib_complex64_from_int16( const int16_t real );
stdlib_complex64_from_uint16( real )
Converts an unsigned 16-bit integer to a single-precision complex floating-point number.
stdlib_complex64_t z = stdlib_complex64_from_uint16( 5 );
The function accepts the following arguments:
- real:
[in] uint16_t
real component.
stdlib_complex64_t stdlib_complex64_from_uint16( const uint16_t real );