summaryrefslogtreecommitdiff
path: root/numeric.c
AgeCommit message (Collapse)Author
2011-09-16Revert "* numeric.c (ruby_float_step): Avoid error on i386 and amd64."naruse
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
2011-09-16* numeric.c (ruby_float_step): Avoid error on i386 and amd64.marcandre
Patch by Vit Ondruch. Issue #4576 [rubyspec:a9525edcd] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-16Revert "* numeric.c (ruby_float_step): Avoid error on i386 and amd64."naruse
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
2011-09-15* numeric.c (ruby_float_step): Avoid error on i386 and amd64.marcandre
Patch by Vit Ondruch. Issue #4576. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05* numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit platformmarcandre
part 1 of [bug #5276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-05* numeric.c (flo_round): Fix criteria for 32 bits platformmarcandre
part 2 of [bug #5276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-04* numeric.c (flo_round): Make Float#round round big values [bug #5272]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-04* numeric.c: Extract integer rounding into int_round_0marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-04* numeric.c (int_round): Integer#round always returns an Integer [Bug #5271]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01* numeric.c (flo_round): substitute machine dependent magic number.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-31* numeric.c (flo_round): Avoid overflow by optimizing for trivial casesmarcandre
[Bug #5227] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29* numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted formrkn
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
2011-08-24* numeric.c (int_round): Fix Integer#round [ruby-core:39096]marcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24* numeric.c: Rdoc fixmarcandre
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-05* numeric.c (rb_infinity, rb_nan): use WORDS_BIGENDIAN to get endian.ngoto
fix [Bug #5160] [ruby-dev:44356] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-11* numeric.c (rb_num2ull): use FIX2LONG instead of FIX2ULONG. seeusa
rb_num2ulong(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09* numeric.c (ULLONG_MAX): fallback definition.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-07* numeric.c (rb_num2ull): use own switch sentense.naruse
Current implementation can't convert 18446744073709551615. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11* numeric.c (rb_enc_uint_chr): fix message format. Bug#4869nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-03* include/ruby/missing.h, numeric.c (round): moved prototype of round()usa
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
2011-05-30* insns.def (opt_mult): as r31805, volatile it.naruse
Without this, clang -O fails calculation. * numeric.c (fix_mul): ditto. * rational.c (f_imul): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-30* numeric.c (int_pow): make sure to assign the result of x * z.naruse
If xz is optimized out, the value won't overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29revert r31783.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29* numeric.c (flo_round): use absolute value as divisor.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29* numeric.c: add #include "interna.h" for rb_big_uminus() prototype.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29* numeric.c (flo_round): fix for negative value.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-13 * numeric.c (flo_coerce): fix a typo in documentation.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-13Add #flo_coerce documentation.shyouhei
Signed-off-by: URABE, Shyouhei <shyouhei@ruby-lang.org> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-09* numeric.c (int_ord): remove K&R style.naruse
patched by Daehyub Kim. https://github.com/ruby/ruby/pull/17 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-14* numeric.c (ruby_float_step): wrong loop condition.usa
fixes [ruby-core:35753], reported by Joey Zhou. * test/ruby/test_range.rb (TestRange#test_step_ruby_core_35753): test above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-22* numeric.c (flo_round): fix inaccurate results.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-22* numeric.c (flo_round): use pow instead of while-loop. fixes #4510naruse
patched by Alex Young [ruby-core:35526] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-01* numeric.c (Init_Numeric): fixed a potential bug when using bccwin32usa
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
2010-10-13* numeric.c (ruby_float_step): fix Numeric#step with infinity unitnaruse
doesn't works well. [ruby-core:32779] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* numeric.c (check_uint): get rid of overflow on LLP64 platforms.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* numeric.c (int_chr): raise error when the value is negative.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* numeric.c (rb_num_to_uint): fix 32bit logic.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-13* numeric.c (rb_num_to_uint): added to check the range of arguments.naruse
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
2010-10-12* numeric.c (rb_num2fix): result of rb_num2long is SIGNED_VALUE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* numeric (check_uint): the mask must refer to VALUE.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* numeric (check_uint): set MSB for negative value.naruse
* 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
2010-10-12* numeric.c (rb_enc_uint_chr): split from int_chr.naruse
* numeric.c (int_chr): use rb_enc_uint_chr. * include/ruby/encoding.h (rb_enc_uint_chr): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-12* numeric.c (int_chr): a codepoint of Ruby M17N must be 32bitnaruse
unsigned int; GB18030 uses MSB. Also note that OnigCodePoint is defined as uisigned int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-29Add links about floating point. [ruby-core:31849]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27* numeric.c (flo_cmp): typo.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-24* numeric.c (flo_cmp): honor the result of infinite? method of thenobu
other. [ruby-core:31470] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-15* numeric.c (fix_divide): must not use rb_rational_new1 for coercionmame
because it returns an argument itself when canonical mode is set. [ruby-core:31279] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-07Merge branch 'mybranch' of git://github.com/orangea/ruby into trunkshyouhei
Conflicts: ChangeLog git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28569 b2dd03c8-39d4-4d8f-98ff-823fe69b080e