Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/rational

    rbb82c03 rf621a148  
    1212// Created On       : Wed Apr  6 17:56:25 2016
    1313// Last Modified By : Peter A. Buhr
    14 // Last Modified On : Wed May  4 14:11:45 2016
    15 // Update Count     : 16
     14// Last Modified On : Mon May  1 08:25:06 2017
     15// Update Count     : 33
    1616//
     17
    1718#ifndef RATIONAL_H
    1819#define RATIONAL_H
     
    2122
    2223// implementation
     24typedef long int RationalImpl;
    2325struct Rational {
    24         long int numerator, denominator;                                        // invariant: denominator > 0
     26        RationalImpl numerator, denominator;                                    // invariant: denominator > 0
    2527}; // Rational
    2628
     
    3133// constructors
    3234void ?{}( Rational * r );
    33 void ?{}( Rational * r, long int n );
    34 void ?{}( Rational * r, long int n, long int d );
     35void ?{}( Rational * r, RationalImpl n );
     36void ?{}( Rational * r, RationalImpl n, RationalImpl d );
    3537
    36 // getter/setter for numerator/denominator
    37 long int numerator( Rational r );
    38 long int numerator( Rational r, long int n );
    39 long int denominator( Rational r );
    40 long int denominator( Rational r, long int d );
     38// getter for numerator/denominator
     39RationalImpl numerator( Rational r );
     40RationalImpl denominator( Rational r );
     41[ RationalImpl, RationalImpl ] ?=?( * [ RationalImpl, RationalImpl ] dest, Rational src );
     42// setter for numerator/denominator
     43RationalImpl numerator( Rational r, RationalImpl n );
     44RationalImpl denominator( Rational r, RationalImpl d );
    4145
    4246// comparison
     
    5761// conversion
    5862double widen( Rational r );
    59 Rational narrow( double f, long int md );
     63Rational narrow( double f, RationalImpl md );
    6064
    6165// I/O
Note: See TracChangeset for help on using the changeset viewer.