Ignore:
Timestamp:
Nov 27, 2024, 6:12:44 PM (3 weeks ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
3e2e9b2, 81e768d
Parents:
71f3d45
Message:

small changes to rational

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/rational.hfa

    r71f3d45 rf5e37a4  
    1212// Created On       : Wed Apr  6 17:56:25 2016
    1313// Last Modified By : Peter A. Buhr
    14 // Last Modified On : Fri Nov  8 17:02:09 2024
    15 // Update Count     : 126
     14// Last Modified On : Wed Nov 27 18:11:07 2024
     15// Update Count     : 128
    1616//
    1717
     
    2121#include "math.trait.hfa"                                                               // arithmetic
    2222
    23 // implementation
     23// Implementation
    2424
    2525forall( T ) {
     
    2828        }; // rational
    2929}
     30
     31// Arithmetic, Relational
    3032
    3133forall( T | arithmetic( T ) ) {
     
    7375        rational(T) ?/?( rational(T) l, rational(T) r );
    7476        rational(T) ?/=?( rational(T) & l, rational(T) r );
    75 
    76         // I/O
    77         forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } )
    78         istype & ?|?( istype &, rational(T) & );
    7977} // distribution
    8078
     79// I/O
     80
    8181forall( T ) {
     82        forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | arithmetic( T ) )
     83        istype & ?|?( istype &, rational(T) & );
     84
    8285        forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, T ); } ) {
    8386                ostype & ?|?( ostype &, rational(T) );
     
    8689} // distribution
    8790
     91// Exponentiation
     92
    8893forall( T | arithmetic( T ) | { T ?\?( T, unsigned long ); } ) {
    8994        rational(T) ?\?( rational(T) x, long int y );
     
    9196} // distribution
    9297
    93 // conversion
     98// Conversion
     99
    94100forall( T | arithmetic( T ) | { double convert( T ); } )
    95101double widen( rational(T) r );
Note: See TracChangeset for help on using the changeset viewer.