Skip to content

Commit

Permalink
Test7
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF committed Jun 24, 2024
1 parent 5c46918 commit 52bce71
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions config/cmake/HDFTests.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,21 +139,38 @@ main(void)
typedef _Fcomplex H5_float_complex;
typedef _Dcomplex H5_double_complex;
typedef _Lcomplex H5_ldouble_complex;
#define H5_make_fcomplex _FCBuild
#define H5_make_dcomplex _CBuild
#define H5_make_lcomplex _LCBuild

#else

typedef float _Complex H5_float_complex;
typedef double _Complex H5_double_complex;
typedef long double _Complex H5_ldouble_complex;

static float _Complex
H5_make_fcomplex(float real, float imaginary)
{
return real + imaginary * (float _Complex)_Complex_I;
}
static double _Complex
H5_make_dcomplex(double real, double imaginary)
{
return real + imaginary * (double _Complex)_Complex_I;
}
static long double _Complex
H5_make_lcomplex(long double real, long double imaginary)
{
return real + imaginary * (long double _Complex)_Complex_I;
}
#endif

int
main(void)
{
H5_float_complex z1 = 1.0f + 3.0f * I;
H5_double_complex z2 = 2.0 + 4.0 * I;
H5_ldouble_complex z3 = 3.0L + 5.0L * I;
H5_float_complex z1 = H5_make_fcomplex(1.0f, 1.0f);
H5_double_complex z2 = H5_make_dcomplex(2.0, 4.0);
H5_ldouble_complex z3 = H5_make_lcomplex(3.0L, 5.0L);
float r1 = crealf(z1);
float i1 = cimagf(z1);
double r2 = creal(z2);
Expand Down

0 comments on commit 52bce71

Please sign in to comment.