// filename:c2011-7-25-ex.c // original examples and/or notes: // (c) ISO/IEC JTC1 SC22 WG14 N1570, April 12, 2011 // C2011 7.25 Type-generic math // compile and output mechanism: // (c) Ogawa Kiyoshi, kaizen@gifu-u.ac.jp, December.29, 2013 // compile errors and/or wornings: // (c) Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn) // Target: x86_64-apple-darwin11.4.2 //Thread model: posix // (c) LLVM 2003-2009 University of Illinois at Urbana-Champaign. #include #include // Example #include int n; float f; double d; long double ld; float complex fc; double complex dc; long double complex ldc; int main(void) { n=f=d=fc=dc=ldc=3.5+4I; return printf("7.25 Type-generic math %d %f %f %Lf %f %f %f\n",n,f,d,ld,fc,dc,ldc); } // output may be // 7.25 Type-generic math 3 3.500000 3.500000 0.000000 512.000123 3.500000 4.000000