Changeset 90c3b1c for src/examples/ato.c
- Timestamp:
- Mar 2, 2016, 4:59:19 PM (7 years ago)
- Branches:
- aaron-thesis, arm-eh, 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:
- bdad1679
- Parents:
- ac1ed49
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/ato.c
rac1ed49 r90c3b1c 11 11 // Created On : Thu Feb 4 08:10:57 2016 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Feb 17 11:44:03201614 // Update Count : 4 213 // Last Modified On : Mon Feb 29 17:57:35 2016 14 // Update Count : 44 15 15 // 16 16 … … 24 24 int main( void ) { 25 25 int i = ato( "-123" ); 26 sout | i | ' ' |"-123" | endl;26 sout | i | "-123" | endl; 27 27 unsigned int ui = ato( "123" ); 28 sout | ui | ' ' |"123" | endl;28 sout | ui | "123" | endl; 29 29 long int li = ato( "-123" ); 30 sout | li | ' ' |"-123" | endl;30 sout | li | "-123" | endl; 31 31 unsigned long int uli = ato( "123" ); 32 sout | uli | ' ' |"123" | endl;32 sout | uli | "123" | endl; 33 33 long long int lli = ato( "-123" ); 34 sout | lli | ' ' |"-123" | endl;34 sout | lli | "-123" | endl; 35 35 unsigned long long int ulli = ato( "123" ); 36 sout | ulli | ' ' |"123" | endl;36 sout | ulli | "123" | endl; 37 37 float f = ato( "-123.456" ); 38 sout | f | ' ' |"-123.456" | endl;38 sout | f | "-123.456" | endl; 39 39 double d = ato( "-123.4567890123456" ); 40 sout | d | ' ' |"-123.4567890123456" | endl;40 sout | d | "-123.4567890123456" | endl; 41 41 long double ld = ato( "-123.45678901234567890123456789" ); 42 sout | ld | ' ' |"-123.45678901234567890123456789" | endl;42 sout | ld | "-123.45678901234567890123456789" | endl; 43 43 float _Complex fc = ato( "-123.456-123.456i" ); 44 sout | fc | ' ' |"-123.456-123.456i" | endl;44 sout | fc | "-123.456-123.456i" | endl; 45 45 double _Complex dc = ato( "-123.4567890123456+123.4567890123456i" ); 46 sout | dc | ' ' |"-123.4567890123456+123.4567890123456i" | endl;46 sout | dc | "-123.4567890123456+123.4567890123456i" | endl; 47 47 long double _Complex ldc = ato( "123.45678901234567890123456789-123.45678901234567890123456789i" ); 48 sout | ldc | ' ' |"123.45678901234567890123456789-123.45678901234567890123456789i" | endl;48 sout | ldc | "123.45678901234567890123456789-123.45678901234567890123456789i" | endl; 49 49 long double _Complex ldc2 = ato( "123.45678901234-123.4567890i" ); 50 sout | ldc2 | ' ' | "123.45678901234567890123456789-123.45678901234567890123456789i" | endl;50 sout | ldc2 | "123.45678901234-123.4567890i" | endl; 51 51 } // main 52 52
Note: See TracChangeset
for help on using the changeset viewer.