Skip to content

Commit

Permalink
fix complex_tests for single and double percision
Browse files Browse the repository at this point in the history
Float and Double were swapped for their tests. `I` is a single
percision constant so cast to double.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
  • Loading branch information
XenuIsWatching committed Dec 10, 2023
1 parent 0ecbaaa commit afeec5b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/src/complex_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ ZTEST(zsl_tests, test_complex_add)
{
/* NOTE: zsl_real_t typedef can't be used with C99 complex numbers. */
#if CONFIG_ZSL_SINGLE_PRECISION
double complex a = 1.0 + 0.4 * I;
double complex b = 1.0 + 0.5 * I;
double complex c = 0.0;
#else
float complex a = 1.0 + 0.4 * I;
float complex b = 1.0 + 0.5 * I;
float complex c = 0.0;
#else
double complex a = 1.0 + 0.4 * (double)I;
double complex b = 1.0 + 0.5 * (double)I;
double complex c = 0.0;
#endif

c = a + b;
Expand Down

0 comments on commit afeec5b

Please sign in to comment.