summaryrefslogtreecommitdiff
path: root/numeric.c
AgeCommit message (Collapse)Author
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
2010-07-01* numeric.c (rb_num2long): accept LONG_MAX < x < LONG_MAX+1 andakr
LONG_MIN-1 < x < LONG_MIN as well because they are converted into the valid range of long by truncation. (rb_num2ulong): accept ULONG_MAX < x < ULONG_MAX+1 and LONG_MIN-1 < x < LONG_MIN as well. (rb_num2ll): accept LLONG_MAX < x < LLONG_MAX+1 and LLONG_MIN-1 < x < LLONG_MIN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-01* numeric.c (rb_num2ulong): fix the lower limit for float.akr
[ruby-dev:41361] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-04Clarification of what '*' matches. Patch by John Wells <john.wells at ↵drbrain
greatworx.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-22* numeric.c (rb_num2ulong): explicit cast to suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-21* marshal.c (w_float): use dtoa directly instead of strippingnobu
needless trailing .0. * numeric.c (flo_to_s): reverted. [ruby-dev:41341] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-19* numeric.c (rb_num2ulong): use rb_big2ulong for data fromnaruse
Bignum. Without this 32bit integer on 32bit environment can't converted into long. This fixes 1) and 2) of [ruby-dev:41289] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13* array.c: Harmonize documentation, in particular regarding:marcandre
- methods returning enumerators - array methods and argument naming (array -> ary, an_array -> new_ary) - minor improvements, typo fixed and styling issues Other documentation errors fixed: - return value was self instead of a new array (or vice-versa) for Array#{pop,shift,permutation,repeated_permutation,keep_if} - Array#rindex was missing the form with a block. * dir.c: ditto. * enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify that #each will be finish before any element is yielded. * error.c: ditto. * gc.c: ditto. * hash.c: ditto. * io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948] * numeric.c: ditto. * range.c: ditto. * string.c: ditto. * struct.c: ditto. * vm_eval.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13* marshal.c (w_float): use minimal representation.nobu
* numeric.c (ruby_dbl2cstr): split from rb_float_new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-12* numeric.c (flo_to_s): fixed broken output including nuls.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-12* numeric.c (flo_to_s): exponent needs 2 digits.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-12* numeric.c (flo_to_s): fill lower zeros.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-12* numeric.c (flo_to_s): make minimum string representation.nobu
[ruby-core:30145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08* error.c: RDoc for subclasses of Exception. [ruby-core:28394]marcandre
* cont.c: ditto * enumerator.c: ditto * io.c: ditto * math.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * thread.c: ditto * transcode.c: ditto. Thanks to Run Paint for some of the documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-30* eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrongmarcandre
number of arguments * file.c (rb_f_test, rb_file_s_umask): ditto * numeric.c (int_chr, num_step): ditto * process.c (rb_f_sleep): ditto * re.c (rb_reg_initialize_m): ditto * signal.c (rb_f_kill, sig_trap): ditto * string.c (rb_str_aref_m, rb_str_aset_m, rb_str_count, rb_str_delete_bang, rb_str_slice_bang, rb_str_sub_bang, str_gsub): ditto * proc.c (curry): rdoc fix git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-29* numeric.c (fix_mul): the width of fixnum is same as long's on allusa
platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-11fix rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-11update rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e