Ignore:
Timestamp:
May 16, 2017, 10:47:34 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
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.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/rational.c

    rfae2cf8 r4203f71  
    1010// Created On       : Mon Mar 28 08:43:12 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May 14 18:10:28 2017
    13 // Update Count     : 57
     12// Last Modified On : Mon May 15 21:32:22 2017
     13// Update Count     : 64
    1414//
    1515
     
    2323void ?{}( int * this, zero_t ) { *this = 0; }
    2424void ?{}( int * this, one_t ) { *this = 1; }
     25double convert( int i ) { return (double)i; }
     26int convert( double d ) { return (int)d; }
    2527
    2628int main() {
     
    5759        sout | a / b | endl;
    5860
    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;
    6971
    7072        sout | "decompose" | endl;
Note: See TracChangeset for help on using the changeset viewer.