source: CIVL/examples/complex/complex_funs.c

main
Last change on this file was ef04a5c, checked in by Stephen Siegel <siegel@…>, 2 days ago

Added some more complex and collective tests.
Some minor code cleanup as well.

  • Property mode set to 100644
File size: 294 bytes
RevLine 
[478ca9e]1#include <complex.h>
2#include <assert.h>
3
4int main(void) {
[ef04a5c]5 double _Complex x = 3.0 + 4.0i;
[478ca9e]6 assert(cabs(x) == 5.0);
[a78dd2e]7 float _Complex x_f = 3.0f + 4.0if;
8 assert(cabsf(x_f) == 5.0f);
9 long double _Complex x_l = 3.0L + 4.0IL;
10 assert(cabsl(x_l) == 5.0L);
11 assert(conj(x) == 3.0 - 4.0i);
[478ca9e]12}
Note: See TracBrowser for help on using the repository browser.