Author: miguel
Date: 2007-10-03 13:35:36 -0400 (Wed, 03 Oct 2007)
New Revision: 86823

Modified:
   trunk/mono/mono/utils/ChangeLog
   trunk/mono/mono/utils/mono-compiler.h
Log:
2007-10-03  Miguel de Icaza  <[EMAIL PROTECTED]>

        * mono-compiler.h (trunc): Make the definition of trunk for MSC
        use ceil or floor instead of always using floor which is
        incorrect.

        Issue pointed out by Aras Pranckevicius <[EMAIL PROTECTED]>

Modified: trunk/mono/mono/utils/ChangeLog
===================================================================
--- trunk/mono/mono/utils/ChangeLog     2007-10-03 17:25:37 UTC (rev 86822)
+++ trunk/mono/mono/utils/ChangeLog     2007-10-03 17:35:36 UTC (rev 86823)
@@ -1,3 +1,11 @@
+2007-10-03  Miguel de Icaza  <[EMAIL PROTECTED]>
+
+       * mono-compiler.h (trunc): Make the definition of trunk for MSC
+       use ceil or floor instead of always using floor which is
+       incorrect.
+
+       Issue pointed out by Aras Pranckevicius <[EMAIL PROTECTED]>
+
 2007-10-02  Jonathan Chambers <[EMAIL PROTECTED]>
 
        * mono-io-portability.c: Init __mono_io_portability_helpers

Modified: trunk/mono/mono/utils/mono-compiler.h
===================================================================
--- trunk/mono/mono/utils/mono-compiler.h       2007-10-03 17:25:37 UTC (rev 
86822)
+++ trunk/mono/mono/utils/mono-compiler.h       2007-10-03 17:35:36 UTC (rev 
86823)
@@ -85,7 +85,7 @@
 
 #include <float.h>
 #define isnan(x)       _isnan(x)
-#define trunc(x)       floor((x))
+#define trunc(x)       (((x) < 0) ? ceil((x)) : floor((x)))
 #define isinf(x)       (_isnan(x) ? 0 : (_fpclass(x) == _FPCLASS_NINF) ? -1 : 
(_fpclass(x) == _FPCLASS_PINF) ? 1 : 0)
 #define isnormal(x)    _finite(x)
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to