Ignore:
Timestamp:
Jan 20, 2021, 4:49:40 PM (9 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
454f478
Parents:
92bfda0 (diff), fd54fef (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:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/rational.hfa

    r92bfda0 rdafbde8  
    2020#include "iostream.hfa"
    2121
    22 trait scalar( otype T ) {
     22trait scalar( T ) {
    2323};
    2424
    25 trait arithmetic( otype T | scalar( T ) ) {
     25trait arithmetic( T | scalar( T ) ) {
    2626        int !?( T );
    2727        int ?==?( T, T );
     
    4646// implementation
    4747
    48 forall( otype RationalImpl | arithmetic( RationalImpl ) ) {
     48forall( RationalImpl | arithmetic( RationalImpl ) ) {
    4949        struct Rational {
    5050                RationalImpl numerator, denominator;                    // invariant: denominator > 0
     
    8989
    9090        // I/O
    91         forall( dtype istype | istream( istype ) | { istype & ?|?( istype &, RationalImpl & ); } )
     91        forall( istype & | istream( istype ) | { istype & ?|?( istype &, RationalImpl & ); } )
    9292        istype & ?|?( istype &, Rational(RationalImpl) & );
    9393
    94         forall( dtype ostype | ostream( ostype ) | { ostype & ?|?( ostype &, RationalImpl ); } ) {
     94        forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, RationalImpl ); } ) {
    9595                ostype & ?|?( ostype &, Rational(RationalImpl) );
    9696                void ?|?( ostype &, Rational(RationalImpl) );
     
    9898} // distribution
    9999
    100 forall( otype RationalImpl | arithmetic( RationalImpl ) |{RationalImpl ?\?( RationalImpl, unsigned long );} )
     100forall( RationalImpl | arithmetic( RationalImpl ) |{RationalImpl ?\?( RationalImpl, unsigned long );} )
    101101Rational(RationalImpl) ?\?( Rational(RationalImpl) x, long int y );
    102102
    103103// conversion
    104 forall( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
     104forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
    105105double widen( Rational(RationalImpl) r );
    106 forall( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl );  RationalImpl convert( double );} )
     106forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl );  RationalImpl convert( double );} )
    107107Rational(RationalImpl) narrow( double f, RationalImpl md );
    108108
Note: See TracChangeset for help on using the changeset viewer.