aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_fixnum.rb
Commit message (Collapse)AuthorAgeFilesLines
* fix r54193nobu2016-03-191-0/+1
| | | | | | | * numeric.c (fix_cmp): invert the result as the comarison is inverted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: suppress parser warningsnobu2016-02-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_plus): simply use LONG2NUM() instead of wronglynaruse2016-02-151-0/+6
| | | | | | | | complex overflow case. * insns.def (opt_sub): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: Numeric#positive? and Numeric#negative?nobu2015-05-171-0/+17
| | | | | | | | | | | | * numeric.c (num_positive_p, num_negative_p): add methods Numeric#positive? and Numeric#negative?. [ruby-core:69173] [Feature #11151] * numeric.c (flo_positive_p, flo_negative_p): specialiazed functions for Float. * complex.c (Init_Complex): Complex do not have positive? and negative? methods git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add assertions for division NaNnobu2014-08-011-0/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: better assertionsnobu2013-12-131-30/+36
| | | | | | * test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_quo): should return a Float for a Float argument.mrkn2013-06-061-0/+1
| | | | | | | | | | [ruby-dev:44710] [Bug #5515] * test/ruby/test_fixnum.rb: Add an assertion for the above change. * test/ruby/test_bignum.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_pow): Handle special cases when base is 0, -1 or +1marcandre2013-02-051-0/+19
| | | | | | [Bug #5713] [Bug #5715] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (bignew_1): Bignum instances are frozen.ko12012-10-281-0/+4
| | | | | | | | | | | | | | | Feature #3222 * include/ruby/ruby.h: Fixnum instances are also frozen. * class.c (singleton_class_of): check Bignum before singleton cheking. * test/ruby/test_bignum.rb: add a test. * test/ruby/test_fixnum.rb: ditto. * test/ruby/marshaltestlib.rb, test/ruby/test_eval.rb, test/ruby/test_object.rb: catch up above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_fixnum.rb (TestFixnum#test_singleton_method): new test.usa2012-08-231-0/+4
| | | | | | | | | | | * test/ruby/test_bignum.rb (TestBignum#test_singleton_method): ditto. * test/ruby/test_float.rb (TestFloat#test_singleton_method): ditto. * test/ruby/test_symbol.rb (TestSymbol#test_singleton_method): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted formrkn2011-08-291-0/+42
| | | | | | | | | | bitwise arithmetic with a Fixnum. #1792 * test/ruby/test_fixnum.rb: add tests for the above change. * bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for bitwise arithmetic with a Bignum. #1792 * test/ruby/test_bignum.rb: add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):nobu2010-04-291-7/+7
| | | | | | use more descriptive assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prec.c: removed. Precision will be redesigned and be back again.yugui2008-09-191-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c.f. [ruby-dev:36352]. * common.mk (COMMON_OBJS): removed prec.o. * inits.c (rb_call_inits): removed Init_Precision. * numeric.c (Init_Numeric): removed inclusion of Precision. removed #induced_from from each class. * rational.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * lib/rdoc/knwon_classes.rb: removed the entry for Precision. * test/ruby/test_prec.rb: removed. * test/ruby/test_integer.rb: removed tests for Precision. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_rational.rb: ditto. * test/ruby/test_complex.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io_m17n.rb: remove a duplicative method.mame2008-05-131-1/+1
| | | | | | | | | | | | | | | | | | | * test/ruby/test_utf16.rb: rename a conflicting method name. * test/ruby/test_array.rb: ditto. * test/ruby/test_file_exhaustive.rb: ditto. * test/ruby/test_hash.rb: ditto. * test/ruby/test_env.rb: ditto. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_rational.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_to_i): remove obsolete method. preparation formatz2008-05-071-7/+0
| | | | | | | | | | symbol GC. * numeric.c (fix_to_sym): ditto. * numeric.c (fix_id2name): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_pack.rb: fix tests for 64bit CPU.mame2008-02-101-1/+4
| | | | | | | | | | | | | | | | | * test/ruby/test_bignum.rb: ditto. * test/ruby/test_file_exhaustive.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_time.rb: ditto. * test/ruby/test_numeric.rb: ditto. * test/ruby/test_fixnum.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_bignum.rb: suppress warnings during test.mame2008-01-311-0/+124
| | | | | | | | | | | | | | * test/ruby/test_enum.rb: ditto. * test/ruby/test_integer.rb: add tests to achieve over 90% test coverage of numeric.c. * test/ruby/test_float.rb: ditto. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_numeric.rb: ditto. * test/ruby/test_pack.rb: add tests to achieve over 90% test coverage of pack.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_pow): integer power calculation: 0**n => 0, matz2007-07-141-1/+1
| | | | | | | | | 1**n => 1, -1**n => 1 (n: even) / -1 (n: odd). * test/ruby/test_fixnum.rb (TestFixnum::test_pow): update test suite. pow(-3, 2^64) gives NaN when pow(3, 2^64) gives Inf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* more tests.akr2007-07-131-0/+52
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check (-0x4000000000000000)/(-1) too.akr2007-07-131-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for [ruby-dev:31210].akr2007-07-131-0/+32
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests for [ruby-dev:31189] and [ruby-dev:31190].akr2007-07-121-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (int_pow): fix previous nubu's commit.usa2007-07-051-0/+26
* test/ruby/test_fixnum.rb: new test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e