Changeset eae8b37 for libcfa/src/rational.cfa
- Timestamp:
- Dec 4, 2024, 10:17:49 PM (2 weeks ago)
- Branches:
- master
- Children:
- fc276f3
- Parents:
- 509ec82
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/rational.cfa
r509ec82 reae8b37 21 21 22 22 // Arithmetic, Relational 23 24 forall( T | arithmetic( T ) ) { 23 forall( T | Simple(T) ) { 25 24 // helper routines 26 27 25 // Calculate greatest common denominator of two numbers, the first of which may be negative. Used to reduce 28 26 // rationals. alternative: https://en.wikipedia.org/wiki/Binary_GCD_algorithm … … 44 42 return gcd( abs( n ), d ); // simplify 45 43 } // simplify 46 44 } 45 46 forall( T | arithmetic( T ) ) { 47 47 // constructors 48 48 … … 197 197 198 198 forall( T ) { 199 forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | arithmetic( T) )199 forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | Simple(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.