- Timestamp:
- May 15, 2017, 10:08:23 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 22634b2
- Parents:
- 9ebd778
- Location:
- src/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/tests/.expect/rational.txt ¶
r9ebd778 r6c6455f 17 17 3/1 18 18 4/3 19 conversion 20 0.75 21 0.142857142857143 22 3.14159292035398 23 3/4 24 1/7 25 355/113 19 26 decompose 20 27 more tests -
TabularUnified src/tests/rational.c ¶
r9ebd778 r6c6455f 10 10 // Created On : Mon Mar 28 08:43:12 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 14 18:10:28201713 // Update Count : 5712 // Last Modified On : Mon May 15 21:32:22 2017 13 // Update Count : 64 14 14 // 15 15 … … 23 23 void ?{}( int * this, zero_t ) { *this = 0; } 24 24 void ?{}( int * this, one_t ) { *this = 1; } 25 double convert( int i ) { return (double)i; } 26 int convert( double d ) { return (int)d; } 25 27 26 28 int main() { … … 57 59 sout | a / b | endl; 58 60 59 //sout | "conversion" | endl;60 //a = (Rational(int)){ 3, 4 };61 //sout | widen( a ) | endl;62 //a = (Rational(int)){ 1, 7 };63 //sout | widen( a ) | endl;64 //a = (Rational(int)){ 355, 113 };65 //sout | widen( a ) | endl;66 //sout | narrow( 0.75, 4 ) | endl;67 //sout | narrow( 0.14285714285714, 16 ) | endl;68 //sout | narrow( 3.14159265358979, 256 ) | endl;61 sout | "conversion" | endl; 62 a = (Rational(int)){ 3, 4 }; 63 sout | widen( a ) | endl; 64 a = (Rational(int)){ 1, 7 }; 65 sout | widen( a ) | endl; 66 a = (Rational(int)){ 355, 113 }; 67 sout | widen( a ) | endl; 68 sout | narrow( 0.75, 4 ) | endl; 69 sout | narrow( 0.14285714285714, 16 ) | endl; 70 sout | narrow( 3.14159265358979, 256 ) | endl; 69 71 70 72 sout | "decompose" | endl;
Note: See TracChangeset
for help on using the changeset viewer.