Changeset 4203f71 for src/tests/rational.c
- Timestamp:
- May 16, 2017, 10:47:34 AM (7 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:
- 02153feb, 9c951e3
- Parents:
- fae2cf8 (diff), 22634b2 (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
Legend:
- Unmodified
- Added
- Removed
-
src/tests/rational.c
rfae2cf8 r4203f71 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.