Changeset 09a767e
- Timestamp:
- Aug 10, 2023, 10:27:05 PM (16 months ago)
- Branches:
- master
- Children:
- b2ab352
- Parents:
- 13600e8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iostream.cfa
r13600e8 r09a767e 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 9 10:10:56202313 // Update Count : 14 3212 // Last Modified On : Thu Aug 10 18:15:44 2023 13 // Update Count : 1442 14 14 // 15 15 … … 172 172 for ( i; 0 ~ @ ) { \ 173 173 if ( i == len ) { fmt( os, "." ); break; } \ 174 if ( buf[i] == '.' || buf[i] == 'e' || buf[i] == 'E' ) break; /* decimal point or scientific ? */ \ 174 if ( buf[i] == '.' || buf[i] == 'e' || buf[i] == 'E' || \ 175 buf[i] == 'p' || buf[i] == 'P' ) break; /* decimal point or scientific ? */ \ 175 176 } /* for */ \ 176 177 } /* if */ \ … … 465 466 fmtstr[star] = '%'; \ 466 467 \ 468 /* Special case printing 0 in hexadecimal as printf does not put the base. */ \ 469 if ( (f.base == 'x' | f.base == 'X') && ! f.flags.nobsdp && f.val == 0 ) { \ 470 fmt( os, f.base == 'x' ? "0x" : "0X" ); \ 471 f.wd -= 2; \ 472 if ( f.wd < 0 ) f.wd = 1; \ 473 } /* if */ \ 474 \ 467 475 if ( ! f.flags.pc ) { /* no precision */ \ 468 476 fmtstr[sizeof(IFMTNP)-2] = f.base; /* sizeof includes '\0' */ \ … … 595 603 len = snprintf( buf, size, format, ##__VA_ARGS__ ); \ 596 604 if ( isfinite( f.val ) && ( f.pc != 0 || ! f.flags.nobsdp ) ) { /* if number, print decimal point when no fraction or exponent */ \ 597 for ( i = 0; i < len && buf[i] != '.' && buf[i] != 'e' && buf[i] != 'E'; i += 1 ); /* decimal point or scientific ? */ \ 605 for ( i = 0; i < len && buf[i] != '.' && buf[i] != 'e' && buf[i] != 'E' && \ 606 buf[i] != 'p' && buf[i] != 'P'; i += 1 ); /* decimal point or scientific ? */ \ 598 607 if ( i == len ) { \ 599 608 if ( ! f.flags.left ) { \
Note: See TracChangeset
for help on using the changeset viewer.