Changeset 2a301ff for libcfa/src/stdlib.cfa
- Timestamp:
- Aug 31, 2023, 11:31:15 PM (2 years ago)
- Branches:
- master
- Children:
- 950c58e
- Parents:
- 92355883 (diff), 686912c (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 edited
-
libcfa/src/stdlib.cfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/stdlib.cfa
r92355883 r2a301ff 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 16 16:31:34202313 // Update Count : 6 3312 // Last Modified On : Mon Aug 14 18:22:36 2023 13 // Update Count : 642 14 14 // 15 15 … … 65 65 //--------------------------------------- 66 66 67 float _Complex strto( const char sptr[], char ** eptr ) { 67 forall( T | { T strto( const char sptr[], char * eptr[], int ); } ) 68 T convert( const char sptr[] ) { 69 char * eptr; 70 errno = 0; // reset 71 T val = strto( sptr, &eptr, 10 ); // attempt conversion 72 if ( errno == ERANGE ) throw ExceptionInst( out_of_range ); 73 if ( eptr == sptr || // conversion failed, no characters generated 74 *eptr != '\0' ) throw ExceptionInst( invalid_argument ); // not at end of str ? 75 return val; 76 } // convert 77 78 float _Complex strto( const char sptr[], char * eptr[] ) { 68 79 float re, im; 69 80 char * eeptr; … … 76 87 } // strto 77 88 78 double _Complex strto( const char sptr[], char * * eptr) {89 double _Complex strto( const char sptr[], char * eptr[] ) { 79 90 double re, im; 80 91 char * eeptr; … … 87 98 } // strto 88 99 89 long double _Complex strto( const char sptr[], char * * eptr) {100 long double _Complex strto( const char sptr[], char * eptr[] ) { 90 101 long double re, im; 91 102 char * eeptr;
Note:
See TracChangeset
for help on using the changeset viewer.