source: tests/complex.cfa @ dc8511c

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resnenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since dc8511c was dc8511c, checked in by Peter A. Buhr <pabuhr@…>, 5 years ago

first attempt at updating suffixes for test programs

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[73abe95]1//
[a933bcb3]2// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
[73abe95]6//
[dc8511c]7// complex.cfa --
[73abe95]8//
[a933bcb3]9// Author           : Peter A. Buhr
10// Created On       : Wed May 24 22:07:31 2017
11// Last Modified By : Peter A. Buhr
[dc8511c]12// Last Modified On : Tue Nov  6 17:51:22 2018
13// Update Count     : 3
[73abe95]14//
[a933bcb3]15
[2f484f5]16#include <stdio.h>
17#include <complex.h>
18#ifdef __CFA__
[73abe95]19#include <fstream.hfa>
[2f484f5]20#endif // __CFA
21
22int main( void ) {
23    double _Complex x = 3 + 2i, y = 4 + 5i, z;
24    z = x + y;
25    printf( "x:%g+%gi y:%g+%gi z:%g+%gi\n", creal(x), cimag(x), creal(y), cimag(y), creal(z), cimag(z) );
26#ifdef __CFA__
27    sout | "x:" | x | "y:" | y | "z:" | z | endl;
28#endif // __CFA
29    x = 2.1 + 1.3i;
30    y = 3.2 + 4.5i;
31    z = x + y;
32    printf( "x:%g+%gi y:%g+%gi z:%g+%gi\n", creal(x), cimag(x), creal(y), cimag(y), creal(z), cimag(z) );
33#ifdef __CFA__
34    sout | "x:" | x | "y:" | y | "z:" | z | endl;
35#endif // __CFA
36}
[a933bcb3]37
38// Local Variables: //
39// tab-width: 4 //
[dc8511c]40// compile-command: "cfa complex.cfa" //
[a933bcb3]41// End: //
Note: See TracBrowser for help on using the repository browser.