Ignore:
Timestamp:
Dec 4, 2024, 10:17:49 PM (2 weeks ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
fc276f3
Parents:
509ec82
Message:

Move enum.hfa/enum.cfa to prelude

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/rational.cfa

    r509ec82 reae8b37  
    2121
    2222// Arithmetic, Relational
    23 
    24 forall( T | arithmetic( T ) ) {
     23forall( T | Simple(T) ) {
    2524        // helper routines
    26 
    2725        // Calculate greatest common denominator of two numbers, the first of which may be negative. Used to reduce
    2826        // rationals.  alternative: https://en.wikipedia.org/wiki/Binary_GCD_algorithm
     
    4442                return gcd( abs( n ), d );                                              // simplify
    4543        } // simplify
    46 
     44}
     45
     46forall( T | arithmetic( T ) ) {
    4747        // constructors
    4848
     
    197197
    198198forall( T ) {
    199         forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | arithmetic( T ) )
     199        forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | Simple(T) )
    200200        istype & ?|?( istype & is, rational(T) & r ) {
    201201                is | r.numerator | r.denominator;
Note: See TracChangeset for help on using the changeset viewer.