Changeset d41280e for src/libcfa/iostream.c
- Timestamp:
- Feb 8, 2016, 10:07:42 AM (10 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, with_gc
- Children:
- c44e622
- Parents:
- 00ede9e (diff), bd85400 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iostream.c
r00ede9e rd41280e 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 4 09:38:58201613 // Update Count : 3712 // Last Modified On : Mon Feb 1 14:20:30 2016 13 // Update Count : 60 14 14 // 15 15 16 #include "iostream.h" 16 #include "iostream" 17 17 18 extern "C" { 18 19 #include <stdio.h> 19 20 #include <string.h> // strlen 21 #include <complex.h> // creal, cimag 20 22 } 21 23 … … 62 64 63 65 forall( dtype ostype | ostream( ostype ) ) 66 ostype * ?|?( ostype *os, float f ) { 67 char buffer[32]; 68 return write( os, buffer, sprintf( buffer, "%g", f ) ); 69 } // ?|? 70 71 forall( dtype ostype | ostream( ostype ) ) 64 72 ostype * ?|?( ostype *os, double d ) { 65 73 char buffer[32]; … … 71 79 char buffer[32]; 72 80 return write( os, buffer, sprintf( buffer, "%Lg", d ) ); 81 } // ?|? 82 83 forall( dtype ostype | ostream( ostype ) ) 84 ostype * ?|?( ostype *os, float _Complex c ) { 85 return os | crealf( c ) | (cimagf( c ) < 0 ? "" : "+") | cimagf( c ) | 'i'; 86 } // ?|? 87 88 forall( dtype ostype | ostream( ostype ) ) 89 ostype * ?|?( ostype *os, double _Complex c ) { 90 return os | creal( c ) | (cimag( c ) < 0 ? "" : "+") | cimag( c ) | 'i'; 91 } // ?|? 92 93 forall( dtype ostype | ostream( ostype ) ) 94 ostype * ?|?( ostype *os, long double _Complex c ) { 95 return os | creall( c ) | (cimagl( c ) < 0 ? "" : "+") | cimagl( c ) | 'i'; 73 96 } // ?|? 74 97
Note:
See TracChangeset
for help on using the changeset viewer.