Index: libcfa/src/bitmanip.hfa
===================================================================
--- libcfa/src/bitmanip.hfa	(revision 2d8f7b0a2facd4932b22d3d03d8138e922c42fe8)
+++ libcfa/src/bitmanip.hfa	(revision da36d25fb1a2f474bae010c7465231546031fa03)
@@ -11,6 +11,6 @@
 // Created On       : Sat Mar 14 18:12:27 2020
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Mon Apr  6 22:17:19 2020
-// Update Count     : 78
+// Last Modified On : Mon Apr 13 22:37:03 2020
+// Update Count     : 110
 // 
 
@@ -67,34 +67,48 @@
 
     // Find most significiant zero bit.
-    unsigned int high0( unsigned char n ) { return n != (typeof(n))-1 ? __bitsizeof(unsigned int) - __builtin_clz( (typeof(n))~n ) : 0; }
-    unsigned int high0( unsigned short int n ) { return n != (typeof(n))-1 ? __bitsizeof(unsigned int) - __builtin_clz( (typeof(n))~n ) : 0; }
-    unsigned int high0( unsigned int n ) { return n != -1 ? __bitsizeof(n) - __builtin_clz( ~n ) : 0; }
-    unsigned int high0( unsigned long int n ) { return n != -1 ? __bitsizeof(n) - __builtin_clzl( ~n ) : 0; }
-    unsigned int high0( unsigned long long int n ) { return n != -1 ? __bitsizeof(n) - __builtin_clzll( ~n ) : 0; }
+    unsigned int high0( unsigned char n ) { return n == (typeof(n))-1 ? 0 : __bitsizeof(unsigned int) - __builtin_clz( (typeof(n))~n ); }
+    unsigned int high0( unsigned short int n ) { return n == (typeof(n))-1 ? 0 : __bitsizeof(unsigned int) - __builtin_clz( (typeof(n))~n ); }
+    unsigned int high0( unsigned int n ) { return n == -1 ? 0 : __bitsizeof(n) - __builtin_clz( ~n ); }
+    unsigned int high0( unsigned long int n ) { return n == -1 ? 0 : __bitsizeof(n) - __builtin_clzl( ~n ); }
+    unsigned int high0( unsigned long long int n ) { return n == -1 ? 0 : __bitsizeof(n) - __builtin_clzll( ~n ); }
 
     // Find most significiant one bit.
-    unsigned int high1( unsigned char n ) { return n != 0 ? __bitsizeof(unsigned int) - __builtin_clz( n ) : 0; }
-    unsigned int high1( unsigned short int n ) { return n != 0 ? __bitsizeof(unsigned int) - __builtin_clz( n ) : 0; }
-    unsigned int high1( unsigned int n ) { return n != 0 ? __bitsizeof(n) - __builtin_clz( n ) : 0; }
-    unsigned int high1( unsigned long int n ) { return n != 0 ? __bitsizeof(n) - __builtin_clzl( n ) : 0; }
-    unsigned int high1( unsigned long long int n ) { return n != 0 ? __bitsizeof(n) - __builtin_clzll( n ) : 0; }
+    unsigned int high1( unsigned char n ) { return n == 0 ? 0 : __bitsizeof(unsigned int) - __builtin_clz( n ); }
+    unsigned int high1( unsigned short int n ) { return n == 0 ? 0 : __bitsizeof(unsigned int) - __builtin_clz( n ); }
+    unsigned int high1( unsigned int n ) { return n == 0 ? 0 : __bitsizeof(n) - __builtin_clz( n ); }
+    unsigned int high1( unsigned long int n ) { return n == 0 ? 0 : __bitsizeof(n) - __builtin_clzl( n ); }
+    unsigned int high1( unsigned long long int n ) { return n == 0 ? 0 : __bitsizeof(n) - __builtin_clzll( n ); }
 
-    // Check for power of 2, clears bits below value, rounding down to the next lower multiple of value.
-    bool is_pow2( int value ) { return (value & (value - 1)) == 0; }
-    bool is_pow2( unsigned long long int value ) { return (value & (value - 1)) == 0; }
+    // Check for power of 2, clears bits below n, rounding down to the next lower multiple of n.
+    bool is_pow2( unsigned char n ) { return n == 0 ? false : (n & (n - 1)) == 0; }
+    bool is_pow2( unsigned short int n ) { return n == 0 ? false : (n & (n - 1)) == 0; }
+    bool is_pow2( unsigned int n ) { return n == 0 ? false : (n & (n - 1)) == 0; }
+    bool is_pow2( unsigned long int n ) { return n == 0 ? false : (n & (n - 1)) == 0; }
+    bool is_pow2( unsigned long long int n ) { return n == 0 ? false : (n & (n - 1)) == 0; }
 
-    // Returns value aligned at the floor of align, clear bits above or equal to align, giving value % align.
-    unsigned int floor2( unsigned int value, unsigned int align ) { assert( is_pow2( align ) ); return value & -align; }
-    unsigned long long int floor2( unsigned long long int value, unsigned long long int align ) { assert( is_pow2( align ) ); return value & -align; }
+    // Returns n aligned at the floor of align, clear bits above or equal to align, giving n % align.
+    // signed char floor2( signed char n, signed char align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // unsigned char floor2( unsigned char n, unsigned char align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // short int floor2( short int n, unsigned short int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // unsigned short int floor2( unsigned short int n, unsigned short int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // int floor2( int n, unsigned int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // unsigned int floor2( unsigned int n, unsigned int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // long int floor2( long int n, unsigned long int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // unsigned long int floor2( unsigned long int n, unsigned long int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+	// long long int floor2( long long int n, unsigned long long int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
+    // unsigned long long int floor2( unsigned long long int n, unsigned long long int align ) { /*assert( is_pow2( align ) );*/ return n & -align; }
 
-    unsigned int floor( unsigned int value, unsigned int align ) { return value / align * align; }
-    unsigned long long int floor( unsigned long long int value, unsigned long long int align ) { return value / align * align; }
+	forall( otype T | { T ?&?( T, T ); T -?( T ); } )
+	T floor2( T n, T align ) { /* assert( is_pow2( align ) ); */ return n & -align; }
 
-    // Returns value aligned at the ceiling of align, negate, round down, negate is the same as round up.
-    unsigned int ceiling2( unsigned int value, unsigned int align ) { assert( is_pow2( align ) ); return -floor2( -value, align ); }
-    unsigned long long int ceiling2( unsigned long long int value, unsigned long long int align ) { assert( is_pow2( align ) ); return -floor2( -value, align ); }
+	forall( otype T | { T ?/?( T, T ); T ?*?( T, T ); } )
+	T floor( T n, T align ) { return n / align * align; }
 
-    unsigned int ceiling( unsigned int value, unsigned int align ) { return (value + (align - 1)) / align; }
-    unsigned long long int ceiling( unsigned long long int value, unsigned long long int align ) { return (value + (align - 1)) / align; }
+    // Returns n aligned at the ceiling of align, negate, round down, negate is the same as round up.
+	forall( otype T | { T floor2( T, T ); T -?( T ); } )
+	T ceiling2( T n, T align ) { /* assert( is_pow2( align ) ); */ return -floor2( -n, align ); }
+
+	forall( otype T | { void ?{}( T &, one_t ); T ?+?( T, T ); T ?-?( T, T ); T ?/?( T, T ); } )
+	T ceiling( T n, T align ) { return (n + (align - (T){1})) / align; }
 } // distribution
 
