* numeric.c (rb_int_bit_length): {Fixnum,Bignum}#bit_length is
unified into Integer.
* bignum.c (rb_big_bit_length): Don't define Bignum#bit_length.
* internal.h (rb_big_bit_length): Declared.
--This iine, and those below, will be ignored--
M ChangeLog
M bignum.c
M internal.h
M numeric.c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (num_floor, num_ceil, num_truncate): add an optional
parameter, digits, as well as Numeric#round. [Feature #12245]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (flo_truncate): add an optional parameter, digits, as
well as Float#round. [Feature #12245]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (int_truncate): add an optional parameter, digits, as
well as Integer#round. [Feature #12245]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (flo_ceil): add an optional parameter, digits, as
well as Float#round. [Feature #12245]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (flo_floor): add an optional parameter, digits, as
well as Integer#floor. [Feature #12245]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (int_ceil): add an optional parameter, digits, as
well as Integer#round. [Feature #12245]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (int_floor): add an optional parameter, digits, as
well as Integer#round.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* bignum.c (rb_big_size): add wrapper function of BIGSIZE and
rename the method funtion with _m suffix.
* numeric.c (int_round_zero_p): extracted from rb_int_round.
optimize for Bignum, and convert VALUE returned by Numeric#size
to long.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (float_invariant_round): extracted from flo_round to
be optimizer-friendly, e.g., tail-call optimization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (flodivmod): round division if it is a finite number
and module is required.
* numeric.c (dbl2ival): do not round here.
* numeric.c (flo_ceil): use dbl2ival.
* numeric.c (flo_round): round explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (flo_round, int_to_s, int_round): use rb_check_arity
instead of rb_scan_args for a simple optional argument.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (rb_int2str): conversion function to String for
generic Integer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
x == FIXNUM_MIN && y == -1. This must be a rare case and it is
expected compiler to handle well.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
but LONG_LONG is always defined as 64bit), or there's int128_t.
* internal.h (DL2NUM): defined if DLONG is defined.
* internal.h (rb_fix_mul_fix): defined for `Fixnum * Fixnum`.
* insns.def (opt_mul): use rb_fix_mul_fix().
* numeric.c (fix_mul): ditto.
* time.c (mul): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (fix_gt, fix_ge, fix_lt, fix_le): optimize comparisons
Fixnum against Bignum by rb_big_cmp in inversed order without
new Bignum instance.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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
class is unknown.
* test/-ext-/integer/test_my_integer.rb (test_my_integer_to_f): modify
a test for the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Integer#<=>.
* numeric.c (Integer#<=>, Fixnum#<=>): move <=> method from Fixnum to
Integer.
* numeric.c (int_cmp): add this method for Integer#<=>.
* test/-ext-/integer/test_my_integer.rb (test_my_integer_cmp): add a
test to examine Integer#<=> for unknown subclasses.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
treatment for subclasses which don't have definitions of to_f method.
* numeric.c (Integer#to_f, Fixnum#to_f): move to_f method from Fixnum
to Integer.
* ext/-test-/integer/my_integer.rb: define helper class for testing
to_f method for a subclass of Integer.
* ext/-test-/integer/extconf.rb: ditto.
* ext/-test-/integer/init.c: ditto.
* test/-ext-/integer/test_my_integer.rb: examine to_f method for a
subclass of Integer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
it is unified with Integer#to_s.
* numeric.c (int_to_s): treat Bignum values directly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
because they are unified with Integer#even? and Integer#odd?.
* numeric.c (Fixnum#zero?, Fixnum#even?, Fixnum#odd?): remove
definitions because they are unified with Numeric#zero?,
Integer#even?, and Integer#odd?.
* numeric.c (num_zero_p, int_even_p, int_odd_p): treat Fixnum and
Bignum values directly.
* test/ruby/test_integer.rb (test_odd_p_even_p): remove meaningless
test case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
integers including Bignums.
* internal.h (rb_fix_plus): Declared to be usable from enum_inject.
* numeric.c (rb_fix_plus): Defined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (num_step_scan_args): comparison String with Numeric
should raise TypeError. it is an invalid type, but not a
mismatch the number of arguments. [ruby-core:62430] [Bug #9810]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (flo_to_s, rb_fix2str): use rb_usascii_str_new instead
of rb_usascii_str_new_cstr, when the length can be calculated.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This patch was created at ROSSConf Berlin 2015 [Bug #11555]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (compare_with_zero): raise TypeError when not
comparable with 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* hash.c (rb_any_hash): use same hash values with Float#hash so
that -0.0 and +0.0 will be identical.
[ruby-core:68541] [Bug #10979]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_funcallv() for no arguments call instead of variadic
rb_funcall().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (flodivmod): all results are NaN if divisor is NaN.
[fix GH-692]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
or an invalid value is returned in #coerce called by
numeric comparison operators and the exception
thrown by the caller has no information on the failure.
In the next release such exception should not be rescued or
should be the cause of the caller exception. nil is accepted
as the "no possible coercion" return value. See #7688.
* test/ruby/test_numeric.rb: Add corresponding test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (num_step_scan_args): check keyword arguments and fail
if they conflict with positional arguments.
[ruby-dev:48177] [Bug #9811]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (num_step_scan_args): turn a macro into a function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
add links to `Object#hash` to each #`hash` methods rdocs.
[Fixes GH-567]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (FLOAT_OUT_OF_RANGE): extract a macro and a helper to
raise RangeError of float.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (finite): disable declaration on Windows, which can be
defined in ruby/win32.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1L << 63 on 64-bit platform is undefined, at least, according to
ISO/IEC 9899 (C99) 6.5.7.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c: use RB_TYPE_P() for special classes instead of switch
with TYPE().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (NUM_STEP_SCAN_ARGS): remove extra class checks, which
cause the incompatibilities.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (NUM_STEP_GET_INF): split from NUM_STEP_SCAN_ARGS(), since
inf is not used in num_step_size().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (NUM_STEP_SCAN_ARGS): On sencond thought, keep
Numeral#step backward compatible in that it raises TypeError
when nil is given as second argument.
* test/ruby/test_float.rb (TestFloat#test_num2dbl): Revert.
* test/ruby/test_numeric.rb (TestNumeric#test_step): Fix test
cases for the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric.c (num_step): Default the limit argument to infinity and
allow it to be omitted. Keyword arguments (by: and to:) are
introduced for ease of use. [Feature #8838] [ruby-dev:47662]
[ruby-dev:42194]
* numeric.c (num_step): Optimize for infinite loop.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
fix_mul to return an incorrect result for -2147483648*-2147483648
on 64 bit platforms
* test/ruby/test_integer_comb.rb (class TestIntegerComb): add test case
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
in rational.c to refer canonicalization state for mathn support.
[ruby-core:41575] [Bug #5736]
* numeric.c (num_quo): ditto.
* test/test_mathn.rb: add a test for the change at r41109.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rational. [ruby-core:41575] [Bug #5736]
* test/ruby/test_numeric.rb: add a test for the above change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
See this ticet about RGENGC.
* gc.c: Add several flags:
* RGENGC_DEBUG: if >0, then prints debug information.
* RGENGC_CHECK_MODE: if >0, add assertions.
* RGENGC_PROFILE: if >0, add profiling features.
check GC.stat and GC::Profiler.
* include/ruby/ruby.h: disable RGENGC by default (USE_RGENGC == 0).
* array.c: add write barriers for T_ARRAY and generate sunny objects.
* include/ruby/ruby.h (RARRAY_PTR_USE): added. Use this macro if
you want to access raw pointers. If you modify the contents which
pointer pointed, then you need to care write barrier.
* bignum.c, marshal.c, random.c: generate T_BIGNUM sunny objects.
* complex.c, include/ruby/ruby.h: add write barriers for T_COMPLEX
and generate sunny objects.
* rational.c (nurat_s_new_internal), include/ruby/ruby.h: add write
barriers for T_RATIONAL and generate sunny objects.
* internal.h: add write barriers for RBasic::klass.
* numeric.c (rb_float_new_in_heap): generate sunny T_FLOAT objects.
* object.c (rb_class_allocate_instance), range.c:
generate sunny T_OBJECT objects.
* string.c: add write barriers for T_STRING and generate sunny objects.
* variable.c: add write barriers for ivars.
* vm_insnhelper.c (vm_setivar): ditto.
* include/ruby/ruby.h, debug.c: use two flags
FL_WB_PROTECTED and FL_OLDGEN.
* node.h (NODE_FL_CREF_PUSHED_BY_EVAL, NODE_FL_CREF_OMOD_SHARED):
move flag bits.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
into unsigned long, which is undefined behavior.
(rb_num2ull): Don't cast a value bigger than LLONG_MAX into
long long, which is undefined behavior.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
instead of VALUE. Refine the validity test conditions.
(check_ushort): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_num2ulong but integer wrap around flag is also returned.
(rb_num2ulong): Use rb_num2ulong_internal.
(rb_num2uint): Use rb_num2ulong_internal and the wrap around flag is
used instead of negative_int_p(val).
(rb_num2ushort): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
LONG_LONG instead of double to unsigned LONG_LONG directly.
This is a challenge to fix a test_num2ull(TestNum2int)
failure (NUM2ULL(-1.0) should be "18446744073709551615" but was "0")
on Mac OS X with 32bit clang.
http://a.mrkn.jp/~mrkn/chkbuild/mountain_lion/ruby-trunk-m32-o0/log/20130328T191100Z.diff.html.gz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(LLONG_MIN_MINUS_ONE_IS_LESS_THAN): Ditto.
(rb_num2long): Use LONG_MIN_MINUS_ONE_IS_LESS_THAN.
(rb_num2ulong): Ditto.
(rb_num2ll): Use LLONG_MIN_MINUS_ONE_IS_LESS_THAN.
(rb_num2ull): Ditto.
* test/-ext-/num2int/test_num2int.rb (asert_num2i_success): Test the
value converted into a Float if Float can represent the value
exactly.
(asert_num2i_error): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enumerator.c (enumerator_with_index_i): allow Bignum as offset, to
get rid of conversion exception and integer overflow.
[ruby-dev:47131] [Bug #8010]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Based on a patch by Zach Morek and Oren K of newhaven.rb
[Github documenting-ruby/ruby#5]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
method raises. The optimization done by r38756 is preserved.
[Bug #7645] [ruby-core:51213]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
instead of rb_rescue + rb_funcall.
This fix is based on the patch by Benoit Daloze.
[Bug #7645] [ruby-core:51213]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_num_coerce_bit.
* numeric.c (rb_num_coerce_bit): the new coerce function for bitwise
binary operation.
* bignum.c (rb_big_and): use coerce to convert the argument, which isn't
a Fixnum nor a Bignum, to the corresponding Integer object so that
bitwise operations can support Integer-mimic objects.
[Bug #1792] [ruby-core:39491]
* bignum.c (rb_big_or): ditto.
* bignum.c (rb_big_xor): ditto.
* numeric.c (bit_coerce): ditto.
* numeric.c (fix_and): ditto.
* numeric.c (fix_or): ditto.
* numeric.c (fix_xor): ditto.
* test/ruby/test_integer.rb: add tests for the above changes.
* test/ruby/test_bignum.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
operations of two NaNs are undefined.
[#1720] [ruby-dev:38725] [ruby-core:36966]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
make all Float objects frozen.
[ruby-dev:46081] [ruby-trunk - Feature #6936]
Most part of patch by NARUSE, Yui <naruse@ruby-lang.org>.
* class.c (singleton_class_of): raise TypeError when
trying to define a singleton method on Float objects.
* vm.c (vm_define_method): ditto.
* test/ruby/marshaltestlib.rb: catch up above changes.
* test/ruby/test_class.rb: ditto.
* test/test_pp.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
64bit CPU environment (sizeof(double) == sizeof(VALUE)).
flonum technique enables to avoid double object creation
if the double value d is in range about between
1.72723e-77 < |d| <= 1.15792e+77 or 0.0.
flonum Float value is immediate and their lowest two bits
are b10.
If flonum is activated, then USE_FLONUM macro is 1.
I'll write detailed in this technique on
https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech
* benchmark/bmx_temp.rb: add an benchmark for simple
Float calculation.
* gc.c (id2ref, rb_obj_id): add flonum Float support.
* include/ruby/intern.h: move decl of rb_float_new(double)
to include/ruby/ruby.h.
* insns.def, vm.c, vm_insnhelper.c: add flonum optimization
and simplify source code.
* vm_insnhelper.h (FLONUM_2_P): added.
* marshal.c: support flonum output.
* numeric.c (rb_float_new_in_heap): added.
* parse.y: support flonum.
* random.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class
can now benefit from the nice default #inspect even if it defines #to_s.
Also, there is no more unexpected change in #inspect result.
* NEWS: Add note about the change.
* bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*):
Adapt internal structures (by aliasing #inspect to #to_s) so they
don't rely on the removed behavior (#inspect calling overridden #to_s).
* test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
* lib/pp.rb (class PP): do not call #to_s anymore, as #inspect
no more does (mame).
* test/test_pp.rb (class PPInspectTest): remove related assertion (mame).
[ruby-core:43238][Feature #6130]
* test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown):
adapt DRb tests with the new change (shirosaki).
[ruby-core:47182][Bug #6866]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Revert "Kernel#inspect: improve consistency and do not call #to_s."
Revert "update PP with recent Kernel#inspect change. Patch by Yusuke Endoh."
r36699 cause test-all failure on test/drb/test_drb.rb and
test/drb/test_drbssl.rb. Run test-all before commit.
Moreover its ChangeLog formst is wrong: see CommitterHowto
https://bugs.ruby-lang.org/projects/ruby/wiki/CommitterHowto#ChangeLog
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
A class can now benefit from the nice default #inspect even if it
defines #to_s. Also, there is no more unexpected change in #inspect
result. Internal structures have been adapted so they don't rely
on the removed behavior (#inspect calling overridden #to_s).
* object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s.
* test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
* bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*):
alias #inspect to #to_s where it was expected.
[ruby-core:43238][Feature #6130]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is longer than or equal DBL_DIG.
[ruby-dev:45960] [ruby-trunk - Bug #6741]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is invalid. [Feature #5855] [Bug #5863] [Bug #5864]
* string.c (rb_str_concat): ditto.
* string.c (rb_str_concat): set encoding as ASCII-8BIT when the string
is US-ASCII and the argument is an integer greater than 127.
* regenc.c (onigenc_mb2_code_to_mbclen): rearrange error code.
* enc/euc_jp.c (code_to_mbclen): ditto.
* enc/shift_jis.c (code_to_mbclen): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-core:35753] [Bug #4576]
* numeric.c (ruby_float_step): correct the error of floating point
numbers on the excluding case.
patched by Masahiro Tanaka [ruby-core:39608]
* numeric.c (ruby_float_step): use the end value when the current
value is greater than or equal to the end value.
patched by Akira Tanaka [ruby-core:39612]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
[ruby-core:35753] [Bug #4576]
* numeric.c (ruby_float_step): correct the error of floating point
numbers on the excluding case.
patched by Masahiro Tanaka [ruby-core:39608]
* numeric.c (ruby_float_step): use the end value when the current
value is greater than or equal to the end value.
patched by Akira Tanaka [ruby-core:39612]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This reverts commit r33285 because of the message of r33284.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
r33282 challenged the precision of floating point but:
* Ruby keeps it as platform dependent
* amd64 won't get this issue because compilers for amd64 uses SSE2 to
calculate floating point numbers instead of x87 FPU.
* this change won't fix the issue under -O
* this commit has no test for the changed behavior
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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
from numeric.c to missing.h. (note: round() is C99 feature, so ruby
provides it if not exists in C runtime.)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
ruby with Microsoft's dll, though we already gave up of supporting
bccwin32. [ruby-core:33503]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Mainly for negative value with NUM2UINT on 32bit environment.
* string.c (rb_str_concat): use rb_num_to_uint.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* numeric (rb_num2uint): return value's type of rb_num2ulong
is VALUE.
* numeric (int_chr): variable i can't be negative.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e