summaryrefslogtreecommitdiffstats
path: root/numeric.c
Commit message (Collapse)AuthorAgeFilesLines
* * include/ruby/st.h (st_hash_func): use st_index_t.nobu2009-09-081-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_quo, int_round): added rdoc.nobu2009-09-051-2/+22
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (round): added declaration. [ruby-dev:39222]nobu2009-09-041-3/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@24361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * suppressed shorten-64-to-32 warnings.nobu2009-07-181-9/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* trivial changes.tadf2009-06-281-8/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: edited rdoc.tadf2009-06-201-2/+3
| | | | | | | | * numeric.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: edited rdoc.tadf2009-06-191-3/+3
| | | | | | | | * rational.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c: edited rdoc.tadf2009-06-191-18/+29
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* due to conflicttadf2009-06-191-113/+119
| | | | git-svn-id: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/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: http://svn.ruby-lang.org/repos/ruby/trunk@23144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (sys_fail2, rb_file_s_readlink, BUFCHECK, rmext),nobu2009-04-061-1/+1
| | | | | | | (rb_file_s_basename): get rid of overflow. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (int_chr): checsk overflow.nobu2009-04-061-1/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@23139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu2009-03-121-1/+1
| | | | | | | | | | numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c (div0), numeric.c (infinite_value): new functions tonobu2009-03-121-3/+16
| | | | | | | get rid of VC divion by 0 warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,nobu2009-03-101-4/+4
| | | | | | | missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_to_s): keeps enough precision for round trip.nobu2009-03-051-3/+5
| | | | | | | [ruby-core:22325] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_eq, flo_gt, flo_ge, flo_lt, flo_le, flo_eql): revertusa2009-02-271-1/+36
| | | | | | | | | | isnan() checks for VC++6. * insns.def (opt_lt, opt_gt): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flo_eq): remove unnecessary NaN check using isnan().matz2009-02-231-15/+2
| | | | | | | | comparison regarding NaN is false anyway. * numeric.c (flo_gt, flo_ge, flo_lt, flo_le, flo_eql): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stripped trailing spaces.nobu2009-02-221-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (ruby_float_step): extracted from num_step().nobu2009-01-041-21/+29
| | | | | | | | * range.c (range_step): uses ruby_float_step() for float range. [ruby-dev:37691] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c: Infinity.numerator returns self. [experimental]tadf2008-12-291-0/+20
| | | | | | | | * numeric.c: Infinity.denominator returns 1. [experimental] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* arrangementtadf2008-12-291-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (int_ord): Integer#ord implemented.akr2008-12-221-0/+21
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in (mingw): no longer uses snprintf and vsnprintf ofnobu2008-12-221-4/+4
| | | | | | | | | | | | | | | | | | msvcrt. * win32/win32.c (rb_w32_vsnprintf, rb_w32_snprintf): removed. * win32/Makefile.sub (config.h): vsnprintf exists in VC7 or later. * win32/mkexports.rb (Exports#initialize): aliases rb_w32_vsnprintf and rb_w32_snprintf for binary compatibility. * sprintf.c (rb_str_format): uses snprintf instead of sprintf. * numeric.c (flo_to_s, rb_num2long, rb_num2ll): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (flodivmod): floating point division should raisematz2008-11-271-0/+1
| | | | | | ZeroDivisionError as integer division. [incompatible] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_step): treat infinite step specially.matz2008-11-241-4/+9
| | | | | | [ruby-dev:37157] fix: #781. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_sadded): remove newly defined singleton methodmatz2008-10-181-1/+3
| | | | | | that should not exist after exception handling. [ruby-dev:36569] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fixed indentation.tadf2008-09-211-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prec.c: removed. Precision will be redesigned and be back again.yugui2008-09-191-67/+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: http://svn.ruby-lang.org/repos/ruby/trunk@19430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * dln.c: newer BeOS support. a patch from Pete Goodevematz2008-09-191-0/+3
| | | | | | <pete.goodeve at computer.org> in [ruby-core:18712]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c: provides predicate real? instead of scalar?.tadf2008-09-161-4/+4
| | | | | | | | | | * complex.c: follows the above change. * lib/cmath.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e