nobu
f4aff7feb1
num2ll and num2ull
...
* ext/-test-/num2int/num2int.c (print_num2ll, print_num2ull): define
only if long long is available, and use long long printf modifier
checked by configure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-18 15:21:04 +00:00
kosaki
ed681d3a82
* bignum.c (rb_big2ull): fix 32bit platform breakage. we must
...
not assume sizeof(VALUE) == sizeof(LONG_LONG).
* test/-ext-/num2int/test_num2int.rb (class TestNum2int):
fix false assumption on 32bit platform.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 05:56:09 +00:00
kosaki
b2a2ba1191
* include/ruby/ruby.h: add NUM2SHORT(), NUM2USHORT() macros.
...
* numeric.c: ditto.
* test/-ext-/num2int/test_num2int.rb: add testcases for NUM2SHORT().
* ext/-test-/num2int/num2int.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:54:34 +00:00
kosaki
d3437b7c1a
* bignum.c (rb_big2ull): fix off-by-twice bug of NUM2ULL.
...
* test/-ext-/num2int/test_num2int.rb (class TestNum2int):
fix a testcase too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:51:56 +00:00
kosaki
11137bed53
* test/-ext-/num2int/test_num2int.rb (class TestNum2int):
...
add FIXNUM tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:47:21 +00:00
kosaki
74a13c7634
* numeric.c (check_uint): fix off-by-one bug of NUM2UINT.
...
* bignum.c (rb_big2ulong): fix off-by-one bug of NUM2ULONG.
* test/-ext-/num2int/test_num2int.rb: add a testcase for NUM2INT()
NUM2UINT(), NUM2LONG(), NUM2ULONG(), NUM2LL and NUM2ULL().
* ext/-test-/num2int/depend: ditto.
* ext/-test-/num2int/extconf.rb: ditto.
* ext/-test-/num2int/num2int.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 03:45:47 +00:00