Changeset b5f17e1
- Timestamp:
- Jan 18, 2022, 8:49:34 PM (2 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 038a0bd
- Parents:
- e57de69
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
re57de69 rb5f17e1 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 17 16:38:32202213 // Update Count : 13 4912 // Last Modified On : Tue Jan 18 08:34:16 2022 13 // Update Count : 1350 14 14 // 15 15 … … 205 205 ostype & ?|?( ostype & os, float f ) { 206 206 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 207 PrintWithDP( os, "% g", f );207 PrintWithDP( os, "%'g", f ); 208 208 return os; 209 209 } // ?|? … … 214 214 ostype & ?|?( ostype & os, double d ) { 215 215 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 216 PrintWithDP( os, "% .*lg", d, DBL_DIG );216 PrintWithDP( os, "%'.*lg", d, DBL_DIG ); 217 217 return os; 218 218 } // ?|? … … 223 223 ostype & ?|?( ostype & os, long double ld ) { 224 224 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 225 PrintWithDP( os, "% .*Lg", ld, LDBL_DIG );225 PrintWithDP( os, "%'.*Lg", ld, LDBL_DIG ); 226 226 return os; 227 227 } // ?|? … … 233 233 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 234 234 // os | crealf( fc ) | nonl; 235 PrintWithDP( os, "% g", crealf( fc ) );236 PrintWithDP( os, "% +g", cimagf( fc ) );235 PrintWithDP( os, "%'g", crealf( fc ) ); 236 PrintWithDP( os, "%'+g", cimagf( fc ) ); 237 237 fmt( os, "i" ); 238 238 return os; … … 245 245 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 246 246 // os | creal( dc ) | nonl; 247 PrintWithDP( os, "% .*lg", creal( dc ), DBL_DIG );248 PrintWithDP( os, "% +.*lg", cimag( dc ), DBL_DIG );247 PrintWithDP( os, "%'.*lg", creal( dc ), DBL_DIG ); 248 PrintWithDP( os, "%'+.*lg", cimag( dc ), DBL_DIG ); 249 249 fmt( os, "i" ); 250 250 return os; … … 257 257 if ( sepPrt$( os ) ) fmt( os, "%s", sepGetCur$( os ) ); 258 258 // os | creall( ldc ) || nonl; 259 PrintWithDP( os, "% .*Lg", creall( ldc ), LDBL_DIG );260 PrintWithDP( os, "% +.*Lg", cimagl( ldc ), LDBL_DIG );259 PrintWithDP( os, "%'.*Lg", creall( ldc ), LDBL_DIG ); 260 PrintWithDP( os, "%'+.*Lg", cimagl( ldc ), LDBL_DIG ); 261 261 fmt( os, "i" ); 262 262 return os; … … 693 693 if ( ! f.flags.pc ) memcpy( &fmtstr, DFMTNP, sizeof(DFMTNP) ); \ 694 694 else memcpy( &fmtstr, DFMTP, sizeof(DFMTP) ); \ 695 int star = 4; /* position before first '*' */ \695 int star = 5; /* position before first '*' */ \ 696 696 \ 697 697 /* Insert flags into spaces before '*', from right to left. */ \ … … 699 699 if ( f.flags.sign ) { fmtstr[star] = '+'; star -= 1; } \ 700 700 if ( f.flags.pad0 ) { fmtstr[star] = '0'; star -= 1; } \ 701 fmtstr[star] = '\''; star -= 1; /* locale */ \ 701 702 fmtstr[star] = '%'; \ 702 703 \ … … 716 717 } // distribution 717 718 718 FloatingPointFMTImpl( double, " * ", "*.* " )719 FloatingPointFMTImpl( long double, " *L ", "*.*L " )719 FloatingPointFMTImpl( double, " * ", " *.* " ) 720 FloatingPointFMTImpl( long double, " *L ", " *.*L " ) 720 721 721 722 // *********************************** character ***********************************
Note: See TracChangeset
for help on using the changeset viewer.