aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
Commit message (Collapse)AuthorAgeFilesLines
* * numeric.c (rb_num2ulong): explicit cast to suppress a warning.nobu2010-05-221-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (w_float): use dtoa directly instead of strippingnobu2010-05-211-43/+41
| | | | | | | | 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
* * numeric.c (rb_num2ulong): use rb_big2ulong for data fromnaruse2010-05-191-2/+27
| | | | | | | | 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
* * array.c: Documentation: change => in call-seq to ->.marcandre2010-05-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* * array.c: Harmonize documentation, in particular regarding:marcandre2010-05-131-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* * marshal.c (w_float): use minimal representation.nobu2010-05-131-41/+43
| | | | | | | * 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
* * numeric.c (flo_to_s): fixed broken output including nuls.nobu2010-05-121-2/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_to_s): exponent needs 2 digits.nobu2010-05-121-4/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_to_s): fill lower zeros.nobu2010-05-121-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_to_s): make minimum string representation.nobu2010-05-121-15/+42
| | | | | | [ruby-core:30145] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c: RDoc for subclasses of Exception. [ruby-core:28394]marcandre2010-05-081-0/+32
| | | | | | | | | | | | | | | | | | | | | | * 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
* * eval.c (make_exception, rb_obj_extend): Fix error messages in case of wrongmarcandre2010-04-301-2/+2
| | | | | | | | | | | | | | | | | | | | | 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
* * numeric.c (fix_mul): the width of fixnum is same as long's on allusa2010-04-291-4/+4
| | | | | | | platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix rdoc.akr2010-02-111-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update rdoc.akr2010-02-111-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_minus): RDoc update. a patch from red stunmatz2010-02-011-1/+1
| | | | | | in [ruby-core:27951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_hash, int_chr): fixed type.nobu2010-01-141-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/defines.h (INFINITY): this is float.naruse2009-12-301-4/+4
| | | | | | | | | | * include/ruby/defines.h (NAN): ditto. * numericc.c (rb_infinity): change content as float. * numericc.c (rb_nan): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add Float::INFINITY and Float::NAN.naruse2009-12-291-4/+18
| | | | | | | | | | | | | | | | | | | | * numeric.c (Init_Numeric): Add Float::INFINITY and Float::NAN. [ruby-dev:1657] [ruby-dev:4760] [ruby-list:7023] [ruby-list:46690] [ruby-core:26632] [ruby-talk:41352] [ruby-talk:203333] * include/ruby/defines.h (INFINITY): defined. * include/ruby/defines.h (NAN): defined. * include/ruby/util.h (ruby_div0): removed. * numeric.c (fix_pow): use INFINITY and NAN instead of ruby_div0(1.0). * marshal.c (r_object0): ditto. * bignum.c (big_fdiv): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_eq): supress a warning on VC++ for x64.usa2009-12-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_quo, int_round): added rdoc.nobu2009-09-051-2/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (round): added declaration. [ruby-dev:39222]nobu2009-09-041-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_method.c (rb_remove_method_id): exported.nobu2009-08-271-3/+3
| | | | | | | * numeric.c (num_sadded): fix for non-ascii method name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_pow,fix_pow): may return complex number.tadf2009-08-161-4/+13
| | | | | | | | * bignum.c (rb_big_pow): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_imaginary): num#i to return imaginary counterpartmatz2009-08-161-0/+16
| | | | | | | | of the given numeric. * complex.c (Init_Complex): undef #i for complex numbers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: checkko12009-08-121-0/+2
| | | | | | | | | | | | definition of (classes)#=== for case/when optimization. Fix Bug #1376 [ruby-core:23190]. * string.c (Init_String), bignum.c (Init_Bignum), numeric.c (Init_Numeric): define String#===, Symbol#===, Bignum#===, Fixnum#===, Float#=== as same as (classes)#==. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_divmod): fixed rdoc. [ruby-core:24862]nobu2009-08-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_hash): normalize -0.0 to 0.0. [ruby-core:24577]matz2009-08-031-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_divide): added an entry to rational.tadf2009-07-121-0/+6
| | | | | | | | | * rational.c (rb_rational_reciprocal): added. * complex.c (f_reciprocal): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (dbl2ival): should raise FloatDomainError on Infinitymatz2009-07-041-7/+1
| | | | | | and NaN as 1.8 does. [ruby-dev:38726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* trivial changes.tadf2009-06-281-8/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: revised rdoc.tadf2009-06-271-111/+111
| | | | | | | | | | * rational.c: ditto. * numeric.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (int_chr): use default_internal encoding as defaultmatz2009-06-261-1/+7
| | | | | | destination encoding if set. [ruby-dev:38717] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_div): don't use num_floor which is actuallytadf2009-06-201-46/+47
| | | | | | | | | | | | | | | | flo_floor. * numeric.c (num_modulo): don't call '%'. * numeric.c (num_divmod): use num_modulo. * numeric.c: defined '%'. * rational.c (nurat_idiv,nurat_mod,nurat_divmod,nurat_rem): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: edited rdoc.tadf2009-06-201-2/+3
| | | | | | | | * numeric.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: edited rdoc.tadf2009-06-191-41/+41
| | | | | | | | | | * rational.c: ditto. * numeric.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: edited rdoc.tadf2009-06-191-3/+3
| | | | | | | | * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c: edited rdoc.tadf2009-06-191-18/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* due to conflicttadf2009-06-191-113/+119
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_cmp): should always return nil for NaN.matz2009-06-191-0/+6
| | | | | | | * numeric.c (flo_cmp): handle infinite value specially using infinite? method internally. [ruby-dev:38681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (*_numerator,*_denominator): moved to rational.c.tadf2009-06-191-53/+0
| | | | | | | | * rational.c (*_numerator,*_denominator): moved from numeric.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c ( num_numerator, num_denominator): usetadf2009-06-181-2/+4
| | | | | | | | to_r [ruby-core:23910]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_cmp): Infinity is greater than any bignummatz2009-06-171-0/+4
| | | | | | | | number. [ruby-dev:38672] * bignum.c (rb_big_cmp): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_big_fdiv): checks whether the given second argumenttadf2009-06-171-1/+3
| | | | | | | | | | | | | | can be converted to float properly. * numeric.c (fix_fdiv): calls rb_big_fdiv when the given second argument is a bignum. * rational.c (nurat_fdiv): should calculate Float(x/y), not Float(x)/Float(y). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * common.mk (bignum.o, numeric.o): depend on util.h.nobu2009-05-261-13/+2
| | | | | | | | | | | * bignum.c, marshal.c: fixed types. * numeric.c (infinite_value): use ruby_div0. * include/ruby/util.h (ruby_div0): moved from marshal.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_long2int, RARRAY_LENINT): check long tonobu2009-05-201-11/+9
| | | | | | | | | cast to int. [ruby-dev:38508] * struct.c, vm_eval.c, vm_insnhelper.c: use RARRAY_LENINT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_to_s): reduce fragments if no precision lost.nobu2009-04-061-3/+6
| | | | | | | c.f. [ruby-core:23075] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e