Index: libmpc/branches/r2d/include/mpc/mpcmath.h
===================================================================
--- libmpc/branches/r2d/include/mpc/mpcmath.h	(revision 151)
+++ libmpc/branches/r2d/include/mpc/mpcmath.h	(revision 156)
@@ -17,4 +17,5 @@
  */
 
+#include <mpc/mpc_types.h>
 
 #ifndef M_PI
@@ -58,2 +59,21 @@
 #define ATAN2F(x,y)  ATAN2 (x,y)
 #define IFLOORF(x)   IFLOOR (x)
+
+typedef union mpc_floatint
+{
+	float   f;
+	mpc_int32_t n;
+} mpc_floatint;
+
+static mpc_inline mpc_int32_t mpc_lrintf(float fVal)
+{
+	mpc_floatint tmp;
+	tmp.f = fVal  + 0x00FF8000;
+	return tmp.n - 0x4B7F8000;
+}
+
+static mpc_inline float mpc_nearbyintf(float fVal)
+{
+	return (float) mpc_lrintf(fVal);
+}
+
