Index: src/libcfa/math
===================================================================
--- src/libcfa/math	(revision 6d54c3aa41d7adfdae895f95bd2a01b8692af900)
+++ src/libcfa/math	(revision a1edafa4cdaef39b89d777ace0514d4622c8c81b)
@@ -10,6 +10,6 @@
 // Created On       : Mon Apr 18 23:37:04 2016
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Jul 20 21:45:07 2017
-// Update Count     : 77
+// Last Modified On : Fri Jul 21 17:03:13 2017
+// Update Count     : 101
 //
 
@@ -83,42 +83,4 @@
 static inline double _Complex pow( double _Complex x, double _Complex y ) { return cpow( x, y ); }
 static inline long double _Complex pow( long double _Complex x, long double _Complex y ) { return cpowl( x, y ); }
-
-static inline float ?\?( float x, float y ) { return powf( x, y ); }
-static inline double ?\?( double x, double y ) { return pow( x, y ); }
-static inline long double ?\?( long double x, long double y ) { return powl( x, y ); }
-static inline float _Complex ?\?( float _Complex x, _Complex float y ) { return cpowf(x, y ); }
-static inline double _Complex ?\?( double _Complex x, _Complex double y ) { return cpow( x, y ); }
-static inline long double _Complex ?\?( long double _Complex x, _Complex long double y ) { return cpowl( x, y ); }
-
-static inline float ?\=?( float * x, float y ) { *x = *x \ y; return *x; }
-static inline double ?\=?( double * x, double y ) { *x = *x \ y; return *x; }
-static inline long double ?\=?( long double * x, long double y ) { *x = *x \ y; return *x; }
-static inline float _Complex ?\=?( float _Complex * x, _Complex float y ) { *x = *x \ y; return *x; }
-static inline double _Complex ?\=?( double _Complex * x, _Complex double y ) { *x = *x \ y; return *x; }
-static inline long double _Complex ?\=?( long double _Complex * x, _Complex long double y ) { *x = *x \ y; return *x; }
-
-static inline long int ?\?( long int x, unsigned long y ) {	// disallow negative exponent
-    if ( y == 0 ) return 1;
-    if ( x == 2 ) return x << (y - 1);
-    long int prod = 1;
-    for ( unsigned int i = 0; i < y; i += 1 ) {
-		prod = prod * x;
-    } // for
-    return prod;
-}
-static inline double ?\?( long int x, signed long y ) {	// allow negative exponent
-    if ( y >=  0 ) return (double)(x \ (unsigned int)y);
-    else return 1.0 / x \ (unsigned int)(-y);
-}
-static inline forall( otype T | { void ?{}( T * this, one_t ); T ?*?( T, T ); } )
-T ?\?( T x, unsigned long y ) {
-    T prod = 1;
-    for ( unsigned int i = 1; i < y; i += 1 ) {
-		prod = prod * x;
-    } // for
-    return prod;
-}
-static inline long int ?\=?( long int * x, unsigned long y ) { *x = *x \ y; return *x; }
-static inline int ?\=?( int * x, unsigned long y ) { *x = *x \ y; return *x; }
 
 //---------------------- Logarithm ----------------------
Index: src/prelude/builtins.c
===================================================================
--- src/prelude/builtins.c	(revision 6d54c3aa41d7adfdae895f95bd2a01b8692af900)
+++ src/prelude/builtins.c	(revision a1edafa4cdaef39b89d777ace0514d4622c8c81b)
@@ -1,3 +1,95 @@
+// 
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+// 
+// builtins.c -- 
+// 
+// Author           : Peter A. Buhr
+// Created On       : Fri Jul 21 16:21:03 2017
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Fri Jul 21 17:01:54 2017
+// Update Count     : 11
+// 
+
+// exception implementation
+
 typedef unsigned long long __cfaabi_exception_type_t;
 
 #include "../libcfa/exception.h"
+
+// exponentiation operator implementation
+
+extern "C" {
+	float powf( float x, float y );
+	double pow( double x, double y );
+	long double powl( long double x, long double y );
+	float _Complex cpowf( float _Complex x, _Complex float z );
+	double _Complex cpow( double _Complex x, _Complex double z );
+	long double _Complex cpowl( long double _Complex x, _Complex long double z );
+} // extern "C"
+
+static inline float ?\?( float x, float y ) { return powf( x, y ); }
+static inline double ?\?( double x, double y ) { return pow( x, y ); }
+static inline long double ?\?( long double x, long double y ) { return powl( x, y ); }
+static inline float _Complex ?\?( float _Complex x, _Complex float y ) { return cpowf(x, y ); }
+static inline double _Complex ?\?( double _Complex x, _Complex double y ) { return cpow( x, y ); }
+static inline long double _Complex ?\?( long double _Complex x, _Complex long double y ) { return cpowl( x, y ); }
+
+static inline long int ?\?( long int pe, unsigned long y ) { // disallow negative exponent
+	if ( y == 0 ) return 1;								// base case
+    if ( pe == 2 ) return pe << (y - 1);				// special case, positive shifting only
+    typeof( pe ) po = 1;								// accumulate odd product
+    for ( ; y > 1; y >>= 1 ) {							// squaring exponentiation, O(log2 y)
+		if ( (y & 1) == 1 ) po *= pe;					// odd ?
+		pe *= pe;
+	} // while
+    return pe * po;
+} // ?\?
+
+// FIX ME, cannot resolve the "T po = 1".
+
+// static inline forall( otype T | { void ?{}( T * this, one_t ); T ?*?( T, T ); } )
+// T ?\?( T pe, unsigned long y ) {
+//     if ( y == 0 ) return 1;
+//     T po = 1;
+//     for ( ; y > 1; y >>= 1 ) {							// squaring exponentiation, O(log2 y)
+// 		if ( (y & 1) == 1 ) po = po * pe;				// odd ?
+// 		pe = pe * pe;
+//     } // for
+//     return pe * po;
+// } // ?\?
+
+// unsigned computation may be faster and larger
+static inline unsigned long int ?\?( unsigned long int pe, unsigned long y ) { // disallow negative exponent
+	if ( y == 0 ) return 1;								// base case
+    if ( pe == 2 ) return pe << (y - 1);				// special case, positive shifting only
+    typeof( pe ) po = 1;								// accumulate odd product
+    for ( ; y > 1; y >>= 1 ) {							// squaring exponentiation, O(log2 y)
+		if ( (y & 1) == 1 ) po *= pe;					// odd ?
+		pe *= pe;
+	} // while
+    return pe * po;
+} // ?\?
+
+static inline double ?\?( long int x, signed long y ) {	// allow negative exponent
+    if ( y >=  0 ) return (double)(x \ (unsigned long int)y);
+    else return 1.0 / x \ (unsigned int)(-y);
+} // ?\?
+
+static inline forall( otype T | { void ?{}( T * this, one_t ); T ?*?( T, T ); double ?/?( double, T ); } )
+double ?\?( T x, signed long y ) {
+    if ( y >=  0 ) return (double)(x \ (unsigned long int)y);
+    else return 1.0 / x \ (unsigned int)(-y);
+} // ?\?
+
+static inline long int ?\=?( long int * x, unsigned long y ) { *x = *x \ y; return *x; }
+static inline long int ?\=?( unsigned long int * x, unsigned long y ) { *x = *x \ y; return *x; }
+static inline int ?\=?( int * x, unsigned long y ) { *x = *x \ y; return *x; }
+static inline int ?\=?( unsigned int * x, unsigned long y ) { *x = *x \ y; return *x; }
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
