1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

eval(..,file,line);String#center

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 1998-03-31 04:52:10 +00:00
parent b41d6e177b
commit a1d8147e44
9 changed files with 34 additions and 10 deletions

View file

@ -588,6 +588,18 @@ num2int(val)
switch (TYPE(val)) {
case T_FIXNUM:
if (sizeof(int) < sizeof(INT)) {
#ifndef INT_MAX
/* assuming 32bit(2's compliment) int */
# define INT_MAX 2147483647
# define INT_MIN (- INT_MAX - 1)
#endif
INT i = FIX2INT(val);
if (INT_MIN < i && i < INT_MAX) {
return i;
}
ArgError("Fixnum too big to convert into `int'");
}
return FIX2INT(val);
case T_FLOAT: