Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/rational.cfa

    rf00b2c2c rfd54fef  
    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.