Index: src/libcfa/rational
===================================================================
--- src/libcfa/rational	(revision 3d9b5dab248af2c0f972053139d0a12c951786d0)
+++ src/libcfa/rational	(revision 630a82a5214317b27ab087ea8d7665b217527f07)
@@ -5,30 +5,38 @@
 // file "LICENCE" distributed with Cforall.
 // 
-// rational -- 
+// rational -- Rational numbers are numbers written as a ratio, i.e., as a fraction, where the numerator (top number)
+//     and the denominator (bottom number) are whole numbers. When creating and computing with rational numbers, results
+//     are constantly reduced to keep the numerator and denominator as small as possible.
 // 
 // Author           : Peter A. Buhr
 // Created On       : Wed Apr  6 17:56:25 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Apr  7 17:23:36 2016
-// Update Count     : 9
+// Last Modified On : Fri Apr  8 11:38:27 2016
+// Update Count     : 15
 // 
 
 #include "iostream"
 
+// implementation
 struct Rational {
 	long int numerator, denominator;					// invariant: denominator > 0
 }; // Rational
 
+// constants
 extern struct Rational 0;
 extern struct Rational 1;
 
-long int gcd( long int a, long int b );
-long int simplify( long int *n, long int *d );
-Rational rational();									// constructor
-Rational rational( long int n );						// constructor
-Rational rational( long int n, long int d );			// constructor
+// constructors
+Rational rational();
+Rational rational( long int n );
+Rational rational( long int n, long int d );
+
+// getter/setter for numerator/denominator
 long int numerator( Rational r );
 long int numerator( Rational r, long int n );
+long int denominator( Rational r );
 long int denominator( Rational r, long int d );
+
+// comparison
 int ?==?( Rational l, Rational r );
 int ?!=?( Rational l, Rational r );
@@ -37,4 +45,6 @@
 int ?>?( Rational l, Rational r );
 int ?>=?( Rational l, Rational r );
+
+// arithmetic
 Rational -?( Rational r );
 Rational ?+?( Rational l, Rational r );
@@ -42,6 +52,10 @@
 Rational ?*?( Rational l, Rational r );
 Rational ?/?( Rational l, Rational r );
+
+// conversion
 double widen( Rational r );
 Rational narrow( double f, long int md );
+
+// I/O
 forall( dtype istype | istream( istype ) ) istype * ?|?( istype *, Rational * );
 forall( dtype ostype | ostream( ostype ) ) ostype * ?|?( ostype *, Rational );
Index: src/libcfa/rational.c
===================================================================
--- src/libcfa/rational.c	(revision 3d9b5dab248af2c0f972053139d0a12c951786d0)
+++ src/libcfa/rational.c	(revision 630a82a5214317b27ab087ea8d7665b217527f07)
@@ -11,6 +11,6 @@
 // Created On       : Wed Apr  6 17:54:28 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Apr  7 17:28:03 2016
-// Update Count     : 12
+// Last Modified On : Fri Apr  8 15:39:17 2016
+// Update Count     : 17
 // 
 
@@ -23,11 +23,15 @@
 } // extern
 
+
+// constants
+
 struct Rational 0 = {0, 1};
 struct Rational 1 = {1, 1};
 
-// Calculate the greatest common denominator of two numbers, the first of which may be negative.  It is used to reduce
-// rationals.
-
-long int gcd( long int a, long int b ) {
+
+// helper
+
+// Calculate greatest common denominator of two numbers, the first of which may be negative. Used to reduce rationals.
+static long int gcd( long int a, long int b ) {
     for ( ;; ) {										// Euclid's algorithm
 		long int r = a % b;
@@ -39,5 +43,5 @@
 } // gcd
 
-long int simplify( long int *n, long int *d ) {
+static long int simplify( long int *n, long int *d ) {
     if ( *d == 0 ) {
 		serr | "Invalid rational number construction: denominator cannot be equal to 0." | endl;
@@ -48,17 +52,20 @@
 } // Rationalnumber::simplify
 
-Rational rational() {									// constructor
-//    r = (Rational){ 0, 1 };
-	Rational t = { 0, 1 };
-	return t;
+
+// constructors
+
+Rational rational() {
+    return (Rational){ 0, 1 };
+//	Rational t = { 0, 1 };
+//	return t;
 } // rational
 
-Rational rational( long int n ) {						// constructor
-//    r = (Rational){ n, 1 };
-	Rational t = { n, 1 };
-	return t;
+Rational rational( long int n ) {
+    return (Rational){ n, 1 };
+//	Rational t = { n, 1 };
+//	return t;
 } // rational
 
-Rational rational( long int n, long int d ) {			// constructor
+Rational rational( long int n, long int d ) {
     long int t = simplify( &n, &d );					// simplify
 //    r = (Rational){ n / t, d / t };
@@ -66,4 +73,7 @@
 	return t;
 } // rational
+
+
+// getter/setter for numerator/denominator
 
 long int numerator( Rational r ) {
@@ -79,4 +89,8 @@
 } // numerator
 
+long int denominator( Rational r ) {
+    return r.denominator;
+} // denominator
+
 long int denominator( Rational r, long int d ) {
     long int prev = r.denominator;
@@ -87,4 +101,7 @@
 } // denominator
 
+
+// comparison
+
 int ?==?( Rational l, Rational r ) {
     return l.numerator * r.denominator == l.denominator * r.numerator;
@@ -110,4 +127,7 @@
     return ! ( l < r );
 } // ?>=?
+
+
+// arithmetic
 
 Rational -?( Rational r ) {
@@ -149,4 +169,7 @@
     return t;
 } // ?/?
+
+
+// conversion
 
 double widen( Rational r ) {
@@ -188,4 +211,7 @@
 } // narrow
 
+
+// I/O
+
 forall( dtype istype | istream( istype ) )
 istype * ?|?( istype *is, Rational *r ) {
