Changeset 5721a6d for src/libcfa/iostream.c
- Timestamp:
- Feb 1, 2016, 2:24:50 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 2a4b088, b4cd03b7
- Parents:
- ae8b942
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream.c
rae8b942 r5721a6d 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jan 29 15:38:34201613 // Update Count : 4712 // Last Modified On : Mon Feb 1 14:20:30 2016 13 // Update Count : 60 14 14 // 15 15 … … 83 83 forall( dtype ostype | ostream( ostype ) ) 84 84 ostype * ?|?( ostype *os, float _Complex c ) { 85 char buffer[64]; 86 return write( os, buffer, sprintf( buffer, "%g+i%g", crealf( c ), cimagf( c ) ) ); 85 return os | crealf( c ) | (cimagf( c ) < 0 ? "" : "+") | cimagf( c ) | 'i'; 87 86 } // ?|? 88 87 89 88 forall( dtype ostype | ostream( ostype ) ) 90 89 ostype * ?|?( ostype *os, double _Complex c ) { 91 char buffer[64]; 92 return write( os, buffer, sprintf( buffer, "%g+i%g", creal( c ), cimag( c ) ) ); 90 return os | creal( c ) | (cimag( c ) < 0 ? "" : "+") | cimag( c ) | 'i'; 93 91 } // ?|? 94 92 95 93 forall( dtype ostype | ostream( ostype ) ) 96 94 ostype * ?|?( ostype *os, long double _Complex c ) { 97 char buffer[64]; 98 return write( os, buffer, sprintf( buffer, "%Lg+i%Lg", creall( c ), cimagl( c ) ) ); 95 return os | creall( c ) | (cimagl( c ) < 0 ? "" : "+") | cimagl( c ) | 'i'; 99 96 } // ?|? 100 97
Note: See TracChangeset
for help on using the changeset viewer.