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.cfa

    r92bfda0 rdafbde8  
    1818#include "stdlib.hfa"
    1919
    20 forall( otype RationalImpl | arithmetic( RationalImpl ) ) {
     20forall( RationalImpl | arithmetic( RationalImpl ) ) {
    2121        // helper routines
    2222
     
    159159        // I/O
    160160
    161         forall( dtype istype | istream( istype ) | { istype & ?|?( istype &, RationalImpl & ); } )
     161        forall( istype & | istream( istype ) | { istype & ?|?( istype &, RationalImpl & ); } )
    162162        istype & ?|?( istype & is, Rational(RationalImpl) & r ) {
    163163                is | r.numerator | r.denominator;
     
    168168        } // ?|?
    169169
    170         forall( dtype ostype | ostream( ostype ) | { ostype & ?|?( ostype &, RationalImpl ); } ) {
     170        forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, RationalImpl ); } ) {
    171171                ostype & ?|?( ostype & os, Rational(RationalImpl) r ) {
    172172                        return os | r.numerator | '/' | r.denominator;
     
    179179} // distribution
    180180
    181 forall( otype RationalImpl | arithmetic( RationalImpl ) | { RationalImpl ?\?( RationalImpl, unsigned long ); } )
     181forall( RationalImpl | arithmetic( RationalImpl ) | { RationalImpl ?\?( RationalImpl, unsigned long ); } )
    182182Rational(RationalImpl) ?\?( Rational(RationalImpl) x, long int y ) {
    183183        if ( y < 0 ) {
     
    190190// conversion
    191191
    192 forall( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
     192forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); } )
    193193double widen( Rational(RationalImpl) r ) {
    194194        return convert( r.numerator ) / convert( r.denominator );
    195195} // widen
    196196
    197 forall( otype RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); RationalImpl convert( double ); } )
     197forall( RationalImpl | arithmetic( RationalImpl ) | { double convert( RationalImpl ); RationalImpl convert( double ); } )
    198198Rational(RationalImpl) narrow( double f, RationalImpl md ) {
    199199        // http://www.ics.uci.edu/~eppstein/numth/frap.c
Note: See TracChangeset for help on using the changeset viewer.