Index: uspace/lib/math/generic/ceil.c
===================================================================
--- uspace/lib/math/generic/ceil.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/ceil.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -34,8 +34,32 @@
 
 #include <ceil.h>
+#include <math.h>
 #include <mathtypes.h>
-#include <trunc.h>
 
-/** Ceiling (round towards positive infinity)
+/** Ceiling (round towards positive infinity, 32-bit floating point)
+ *
+ * @param val Floating point number.
+ *
+ * @return Number rounded towards positive infinity.
+ */
+float32_t float32_ceil(float32_t val)
+{
+	float32_u t;
+	float32_u v;
+	float32_u r;
+	
+	v.val = val;
+	t.val = trunc_f32(val);
+	
+	if (v.data.parts.sign == 1 || val == t.val) {
+		r = t;
+	} else {
+		r.val = t.val + 1.0;
+	}
+	
+	return r.val;
+}
+
+/** Ceiling (round towards positive infinity, 64-bit floating point)
  *
  * @param val Floating point number.
@@ -50,5 +74,5 @@
 	
 	v.val = val;
-	t.val = float64_trunc(val);
+	t.val = trunc_f64(val);
 	
 	if (v.data.parts.sign == 1 || val == t.val) {
Index: uspace/lib/math/generic/exp.c
===================================================================
--- uspace/lib/math/generic/exp.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/exp.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -49,5 +49,5 @@
 };
 
-/** Exponential approximation by Taylor series (32-))
+/** Exponential approximation by Taylor series (32-bit floating point)
  *
  * Compute the approximation of exponential by a Taylor
@@ -61,8 +61,8 @@
  *
  */
-static float64_t taylor_exp_32(float64_t arg)
+static float32_t taylor_exp_32(float32_t arg)
 {
-	float64_t ret = 1;
-	float64_t nom = 1;
+	float32_t ret = 1;
+	float32_t nom = 1;
 	
 	for (unsigned int i = 0; i < TAYLOR_DEGREE_32; i++) {
@@ -74,5 +74,5 @@
 }
 
-/** Exponential approximation by Taylor series
+/** Exponential approximation by Taylor series (64-bit floating point)
  *
  * Compute the approximation of exponential by a Taylor
@@ -99,5 +99,5 @@
 }
 
-/** Single precision exponential
+/** Exponential (32-bit floating point)
  *
  * Compute exponential value.
@@ -121,5 +121,5 @@
 	 */
 
-	i = float32_trunc(arg * M_LOG2E);
+	i = trunc_f32(arg * M_LOG2E);
 	f = arg * M_LOG2E - i;
 
@@ -129,5 +129,5 @@
 }
 
-/** Double precision exponential
+/** Exponential (64-bit floating point)
  *
  * Compute exponential value.
@@ -151,5 +151,5 @@
 	 */
 
-	i = float64_trunc(arg * M_LOG2E);
+	i = trunc_f64(arg * M_LOG2E);
 	f = arg * M_LOG2E - i;
 
Index: uspace/lib/math/generic/floor.c
===================================================================
--- uspace/lib/math/generic/floor.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/floor.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -34,8 +34,29 @@
 
 #include <floor.h>
+#include <math.h>
 #include <mathtypes.h>
-#include <trunc.h>
 
-/** Ceiling (round towards negative infinity)
+/** Ceiling (round towards negative infinity, 32-bit floating point)
+ *
+ * @param val Floating point number.
+ *
+ * @return Number rounded towards negative infinity.
+ */
+
+float32_t float32_floor(float32_t val)
+{
+	float32_t t;
+	float32_u v;
+	
+	v.val = val;
+	t = trunc_f32(val);
+	
+	if (v.data.parts.sign == 0 || val == t)
+		return t;
+	else
+		return t - 1.0;
+}
+
+/** Ceiling (round towards negative infinity, 64-bit floating point)
  *
  * @param val Floating point number.
@@ -50,5 +71,5 @@
 	
 	v.val = val;
-	t = float64_trunc(val);
+	t = trunc_f64(val);
 	
 	if (v.data.parts.sign == 0 || val == t)
Index: uspace/lib/math/generic/log.c
===================================================================
--- uspace/lib/math/generic/log.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/log.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -40,5 +40,5 @@
 #define TAYLOR_DEGREE_64  63
 
-/** Single precision log(1 - arg) approximation by Taylor series
+/** log(1 - arg) approximation by Taylor series (32-bit floating point)
  *
  * Compute the approximation of log(1 - arg) by a Taylor
@@ -68,5 +68,5 @@
 }
 
-/** Double precision log(1 - arg) approximation by Taylor series
+/** log(1 - arg) approximation by Taylor series (64-bit floating point)
  *
  * Compute the approximation of log(1 - arg) by a Taylor
@@ -96,5 +96,5 @@
 }
 
-/** Single precision logarithm
+/** Natural logarithm (32-bit floating point)
  *
  * @param arg Argument.
@@ -126,5 +126,5 @@
 }
 
-/** Double precision logarithm
+/** Natural logarithm (64-bit floating point)
  *
  * @param arg Argument.
Index: uspace/lib/math/generic/mod.c
===================================================================
--- uspace/lib/math/generic/mod.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/mod.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -36,5 +36,30 @@
 #include <mod.h>
 
-/** Double precision modulo
+/** Remainder function (32-bit floating point)
+ *
+ * Calculate the modulo of dividend by divisor.
+ *
+ * This is a very basic implementation that uses
+ * division and multiplication (instead of exact
+ * arithmetics). Thus the result might be very
+ * imprecise (depending on the magnitude of the
+ * arguments).
+ *
+ * @param dividend Dividend.
+ * @param divisor  Divisor.
+ *
+ * @return Modulo.
+ *
+ */
+float32_t float32_mod(float32_t dividend, float32_t divisor)
+{
+	// FIXME: replace with exact arithmetics
+	
+	float32_t quotient = trunc_f32(dividend / divisor);
+	
+	return (dividend - quotient * divisor);
+}
+
+/** Remainder function (64-bit floating point)
  *
  * Calculate the modulo of dividend by divisor.
@@ -56,5 +81,5 @@
 	// FIXME: replace with exact arithmetics
 	
-	float64_t quotient = trunc(dividend / divisor);
+	float64_t quotient = trunc_f64(dividend / divisor);
 	
 	return (dividend - quotient * divisor);
Index: uspace/lib/math/generic/pow.c
===================================================================
--- uspace/lib/math/generic/pow.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/pow.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -52,5 +52,5 @@
 {
 	/* x^y = (e ^ log(x))^y = e ^ (log(x) * y) */
-	return float32_exp(float32_log(x) * y);
+	return exp_f32(log_f32(x) * y);
 }
 
@@ -68,5 +68,5 @@
 {
 	/* x^y = (e ^ log(x))^y = e ^ (log(x) * y) */
-	return float64_exp(float64_log(x) * y);
+	return exp_f64(log_f64(x) * y);
 }
 
Index: uspace/lib/math/generic/trig.c
===================================================================
--- uspace/lib/math/generic/trig.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/trig.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2015 Jiri Svoboda
  * Copyright (c) 2014 Martin Decky
  * All rights reserved.
@@ -47,5 +48,5 @@
 };
 
-/** Sine approximation by Taylor series
+/** Sine approximation by Taylor series (32-bit floating point)
  *
  * Compute the approximation of sine by a Taylor
@@ -59,5 +60,34 @@
  *
  */
-static float64_t taylor_sin(float64_t arg)
+static float32_t taylor_sin_32(float32_t arg)
+{
+	float32_t ret = 0;
+	float32_t nom = 1;
+	
+	for (unsigned int i = 0; i < TAYLOR_DEGREE_32; i++) {
+		nom *= arg;
+		
+		if ((i % 4) == 0)
+			ret += nom / factorials[i];
+		else if ((i % 4) == 2)
+			ret -= nom / factorials[i];
+	}
+	
+	return ret;
+}
+
+/** Sine approximation by Taylor series (64-bit floating point)
+ *
+ * Compute the approximation of sine by a Taylor
+ * series (using the first TAYLOR_DEGREE terms).
+ * The approximation is reasonably accurate for
+ * arguments within the interval [-pi/4, pi/4].
+ *
+ * @param arg Sine argument.
+ *
+ * @return Sine value approximation.
+ *
+ */
+static float64_t taylor_sin_64(float64_t arg)
 {
 	float64_t ret = 0;
@@ -76,5 +106,5 @@
 }
 
-/** Cosine approximation by Taylor series
+/** Cosine approximation by Taylor series (32-bit floating point)
  *
  * Compute the approximation of cosine by a Taylor
@@ -88,5 +118,34 @@
  *
  */
-static float64_t taylor_cos(float64_t arg)
+static float32_t taylor_cos_32(float32_t arg)
+{
+	float32_t ret = 1;
+	float32_t nom = 1;
+	
+	for (unsigned int i = 0; i < TAYLOR_DEGREE_32; i++) {
+		nom *= arg;
+		
+		if ((i % 4) == 1)
+			ret -= nom / factorials[i];
+		else if ((i % 4) == 3)
+			ret += nom / factorials[i];
+	}
+	
+	return ret;
+}
+
+/** Cosine approximation by Taylor series (64-bit floating point)
+ *
+ * Compute the approximation of cosine by a Taylor
+ * series (using the first TAYLOR_DEGREE terms).
+ * The approximation is reasonably accurate for
+ * arguments within the interval [-pi/4, pi/4].
+ *
+ * @param arg Cosine argument.
+ *
+ * @return Cosine value approximation.
+ *
+ */
+static float64_t taylor_cos_64(float64_t arg)
 {
 	float64_t ret = 1;
@@ -105,5 +164,5 @@
 }
 
-/** Sine value for values within base period
+/** Sine value for values within base period (32-bit floating point)
  *
  * Compute the value of sine for arguments within
@@ -117,5 +176,5 @@
  *
  */
-static float64_t base_sin(float64_t arg)
+static float32_t base_sin_32(float32_t arg)
 {
 	unsigned int period = arg / (M_PI / 4);
@@ -123,20 +182,53 @@
 	switch (period) {
 	case 0:
-		return taylor_sin(arg);
+		return taylor_sin_32(arg);
 	case 1:
 	case 2:
-		return taylor_cos(arg - M_PI / 2);
+		return taylor_cos_32(arg - M_PI / 2);
 	case 3:
 	case 4:
-		return -taylor_sin(arg - M_PI);
+		return -taylor_sin_32(arg - M_PI);
 	case 5:
 	case 6:
-		return -taylor_cos(arg - 3 * M_PI / 2);
+		return -taylor_cos_32(arg - 3 * M_PI / 2);
 	default:
-		return taylor_sin(arg - 2 * M_PI);
-	}
-}
-
-/** Cosine value for values within base period
+		return taylor_sin_32(arg - 2 * M_PI);
+	}
+}
+
+/** Sine value for values within base period (64-bit floating point)
+ *
+ * Compute the value of sine for arguments within
+ * the base period [0, 2pi]. For arguments outside
+ * the base period the returned values can be
+ * very inaccurate or even completely wrong.
+ *
+ * @param arg Sine argument.
+ *
+ * @return Sine value.
+ *
+ */
+static float64_t base_sin_64(float64_t arg)
+{
+	unsigned int period = arg / (M_PI / 4);
+	
+	switch (period) {
+	case 0:
+		return taylor_sin_64(arg);
+	case 1:
+	case 2:
+		return taylor_cos_64(arg - M_PI / 2);
+	case 3:
+	case 4:
+		return -taylor_sin_64(arg - M_PI);
+	case 5:
+	case 6:
+		return -taylor_cos_64(arg - 3 * M_PI / 2);
+	default:
+		return taylor_sin_64(arg - 2 * M_PI);
+	}
+}
+
+/** Cosine value for values within base period (32-bit floating point)
  *
  * Compute the value of cosine for arguments within
@@ -150,5 +242,5 @@
  *
  */
-static float64_t base_cos(float64_t arg)
+static float32_t base_cos_32(float32_t arg)
 {
 	unsigned int period = arg / (M_PI / 4);
@@ -156,20 +248,53 @@
 	switch (period) {
 	case 0:
-		return taylor_cos(arg);
+		return taylor_cos_32(arg);
 	case 1:
 	case 2:
-		return -taylor_sin(arg - M_PI / 2);
+		return -taylor_sin_32(arg - M_PI / 2);
 	case 3:
 	case 4:
-		return -taylor_cos(arg - M_PI);
+		return -taylor_cos_32(arg - M_PI);
 	case 5:
 	case 6:
-		return taylor_sin(arg - 3 * M_PI / 2);
+		return taylor_sin_32(arg - 3 * M_PI / 2);
 	default:
-		return taylor_cos(arg - 2 * M_PI);
-	}
-}
-
-/** Double precision sine
+		return taylor_cos_32(arg - 2 * M_PI);
+	}
+}
+
+/** Cosine value for values within base period (64-bit floating point)
+ *
+ * Compute the value of cosine for arguments within
+ * the base period [0, 2pi]. For arguments outside
+ * the base period the returned values can be
+ * very inaccurate or even completely wrong.
+ *
+ * @param arg Cosine argument.
+ *
+ * @return Cosine value.
+ *
+ */
+static float64_t base_cos_64(float64_t arg)
+{
+	unsigned int period = arg / (M_PI / 4);
+	
+	switch (period) {
+	case 0:
+		return taylor_cos_64(arg);
+	case 1:
+	case 2:
+		return -taylor_sin_64(arg - M_PI / 2);
+	case 3:
+	case 4:
+		return -taylor_cos_64(arg - M_PI);
+	case 5:
+	case 6:
+		return taylor_sin_64(arg - 3 * M_PI / 2);
+	default:
+		return taylor_cos_64(arg - 2 * M_PI);
+	}
+}
+
+/** Sine (32-bit floating point)
  *
  * Compute sine value.
@@ -180,15 +305,34 @@
  *
  */
+float32_t float32_sin(float32_t arg)
+{
+	float32_t base_arg = fmod_f32(arg, 2 * M_PI);
+	
+	if (base_arg < 0)
+		return -base_sin_32(-base_arg);
+	
+	return base_sin_32(base_arg);
+}
+
+/** Sine (64-bit floating point)
+ *
+ * Compute sine value.
+ *
+ * @param arg Sine argument.
+ *
+ * @return Sine value.
+ *
+ */
 float64_t float64_sin(float64_t arg)
 {
-	float64_t base_arg = fmod(arg, 2 * M_PI);
+	float64_t base_arg = fmod_f64(arg, 2 * M_PI);
 	
 	if (base_arg < 0)
-		return -base_sin(-base_arg);
-	
-	return base_sin(base_arg);
-}
-
-/** Double precision cosine
+		return -base_sin_64(-base_arg);
+	
+	return base_sin_64(base_arg);
+}
+
+/** Cosine (32-bit floating point)
  *
  * Compute cosine value.
@@ -199,12 +343,31 @@
  *
  */
+float32_t float32_cos(float32_t arg)
+{
+	float32_t base_arg = fmod_f32(arg, 2 * M_PI);
+	
+	if (base_arg < 0)
+		return base_cos_32(-base_arg);
+	
+	return base_cos_32(base_arg);
+}
+
+/** Cosine (64-bit floating point)
+ *
+ * Compute cosine value.
+ *
+ * @param arg Cosine argument.
+ *
+ * @return Cosine value.
+ *
+ */
 float64_t float64_cos(float64_t arg)
 {
-	float64_t base_arg = fmod(arg, 2 * M_PI);
+	float64_t base_arg = fmod_f64(arg, 2 * M_PI);
 	
 	if (base_arg < 0)
-		return base_cos(-base_arg);
-	
-	return base_cos(base_arg);
+		return base_cos_64(-base_arg);
+	
+	return base_cos_64(base_arg);
 }
 
Index: uspace/lib/math/generic/trunc.c
===================================================================
--- uspace/lib/math/generic/trunc.c	(revision e6f57664d3ef46f2516e2135088330f4f6eb2ba4)
+++ uspace/lib/math/generic/trunc.c	(revision 9adb61d80bc69044524f4944f7690ac8768a30e0)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2015 Jiri Svoboda
  * Copyright (c) 2014 Martin Decky
  * All rights reserved.
