Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/rational

    rf621a148 rbb82c03  
    1212// Created On       : Wed Apr  6 17:56:25 2016
    1313// Last Modified By : Peter A. Buhr
    14 // Last Modified On : Mon May  1 08:25:06 2017
    15 // Update Count     : 33
     14// Last Modified On : Wed May  4 14:11:45 2016
     15// Update Count     : 16
    1616//
    17 
    1817#ifndef RATIONAL_H
    1918#define RATIONAL_H
     
    2221
    2322// implementation
    24 typedef long int RationalImpl;
    2523struct Rational {
    26         RationalImpl numerator, denominator;                                    // invariant: denominator > 0
     24        long int numerator, denominator;                                        // invariant: denominator > 0
    2725}; // Rational
    2826
     
    3331// constructors
    3432void ?{}( Rational * r );
    35 void ?{}( Rational * r, RationalImpl n );
    36 void ?{}( Rational * r, RationalImpl n, RationalImpl d );
     33void ?{}( Rational * r, long int n );
     34void ?{}( Rational * r, long int n, long int d );
    3735
    38 // getter for numerator/denominator
    39 RationalImpl numerator( Rational r );
    40 RationalImpl denominator( Rational r );
    41 [ RationalImpl, RationalImpl ] ?=?( * [ RationalImpl, RationalImpl ] dest, Rational src );
    42 // setter for numerator/denominator
    43 RationalImpl numerator( Rational r, RationalImpl n );
    44 RationalImpl denominator( Rational r, RationalImpl d );
     36// getter/setter for numerator/denominator
     37long int numerator( Rational r );
     38long int numerator( Rational r, long int n );
     39long int denominator( Rational r );
     40long int denominator( Rational r, long int d );
    4541
    4642// comparison
     
    6157// conversion
    6258double widen( Rational r );
    63 Rational narrow( double f, RationalImpl md );
     59Rational narrow( double f, long int md );
    6460
    6561// I/O
Note: See TracChangeset for help on using the changeset viewer.