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.cfa

    r71f3d45 rf5e37a4  
    1010// Created On       : Wed Apr  6 17:54:28 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Nov 11 22:37:12 2024
    13 // Update Count     : 206
     12// Last Modified On : Wed Nov 27 18:06:43 2024
     13// Update Count     : 208
    1414//
    1515
     
    1919
    2020#pragma GCC visibility push(default)
     21
     22// Arithmetic, Relational
    2123
    2224forall( T | arithmetic( T ) ) {
     
    190192                return l = l / r;
    191193        } // ?/?
    192 
    193         // I/O
    194 
    195         forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } )
     194} // distribution
     195
     196// I/O
     197
     198forall( T ) {
     199        forall( istype & | istream( istype ) | { istype & ?|?( istype &, T & ); } | arithmetic( T ) )
    196200        istype & ?|?( istype & is, rational(T) & r ) {
    197201                is | r.numerator | r.denominator;
     
    201205                return is;
    202206        } // ?|?
    203 } // distribution
    204 
    205 forall( T ) {
     207
    206208        forall( ostype & | ostream( ostype ) | { ostype & ?|?( ostype &, T ); } ) {
    207209        ostype & ?|?( ostype & os, rational(T) r ) {
     
    212214} // distribution
    213215
     216// Exponentiation
     217
    214218forall( T | arithmetic( T ) | { T ?\?( T, unsigned long ); } ) {
    215219        rational(T) ?\?( rational(T) x, long int y ) {
     
    226230} // distribution
    227231
    228 // conversion
     232// Conversion
    229233
    230234forall( T | arithmetic( T ) | { double convert( T ); } )
Note: See TracChangeset for help on using the changeset viewer.