move RSHIFT from numeric.h to numeric.c

This commit is contained in:
Yukihiro Matsumoto
2012-06-13 15:40:41 +09:00
parent 6a5019d37f
commit db3d72a471
2 changed files with 2 additions and 3 deletions
-1
View File
@@ -13,7 +13,6 @@ extern "C" {
#include <limits.h>
#define RSHIFT(x,y) ((x)>>(int)(y))
#define POSFIXABLE(f) ((f) <= INT_MAX)
#define NEGFIXABLE(f) ((f) >= INT_MIN)
#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))
+2 -2
View File
@@ -28,7 +28,7 @@
#include <ieeefp.h>
#endif
#define SIGNED_VALUE intptr_t
#define RSHIFT(x,y) ((x)>>(int)(y))
#ifdef MRB_USE_FLOAT
#define floor(f) floorf(f)
@@ -697,7 +697,7 @@ int_succ(mrb_state *mrb, mrb_value num)
return mrb_funcall(mrb, num, "+", 1, mrb_fixnum_value(1));
}
#define SQRT_INT_MAX ((SIGNED_VALUE)1<<((sizeof(mrb_int)*CHAR_BIT-1)/2))
#define SQRT_INT_MAX ((mrb_int)1<<((sizeof(mrb_int)*CHAR_BIT-1)/2))
/*tests if N*N would overflow*/
#define FIT_SQRT_INT(n) (((n)<SQRT_INT_MAX)&&((n)>=-SQRT_INT_MAX))