Changeset f6a4917 for libcfa/src/rational.cfa
- Timestamp:
- Aug 25, 2022, 10:43:36 PM (20 months ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 51fbba5
- Parents:
- d2f09e4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/rational.cfa
rd2f09e4 rf6a4917 10 10 // Created On : Wed Apr 6 17:54:28 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 20 16:30:06 202113 // Update Count : 19 312 // Last Modified On : Thu Aug 25 18:09:58 2022 13 // Update Count : 194 14 14 // 15 15 … … 26 26 // rationals. alternative: https://en.wikipedia.org/wiki/Binary_GCD_algorithm 27 27 static T gcd( T a, T b ) { 28 for ( ;; ) {// Euclid's algorithm28 for () { // Euclid's algorithm 29 29 T r = a % b; 30 30 if ( r == (T){0} ) break; … … 246 246 247 247 // find terms until denom gets too big 248 for ( ;;) {248 for () { 249 249 ai = convert( f ); 250 250 if ( ! (m10 * ai + m11 <= md) ) break;
Note: See TracChangeset
for help on using the changeset viewer.