Changes in libcfa/src/rational.cfa [eae8b37:f5e37a4]
- File:
-
- 1 edited
-
libcfa/src/rational.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/rational.cfa
reae8b37 rf5e37a4 21 21 22 22 // Arithmetic, Relational 23 forall( T | Simple(T) ) { 23 24 forall( T | arithmetic( T ) ) { 24 25 // helper routines 26 25 27 // Calculate greatest common denominator of two numbers, the first of which may be negative. Used to reduce 26 28 // rationals. alternative: https://en.wikipedia.org/wiki/Binary_GCD_algorithm … … 42 44 return gcd( abs( n ), d ); // simplify 43 45 } // simplify 44 } 45 46 forall( T | arithmetic( T ) ) { 46 47 47 // constructors 48 48 … … 197 197 198 198 forall( T ) { 199 forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | Simple(T) )199 forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | arithmetic( T ) ) 200 200 istype & ?|?( istype & is, rational(T) & r ) { 201 201 is | r.numerator | r.denominator;
Note:
See TracChangeset
for help on using the changeset viewer.