summaryrefslogtreecommitdiff
path: root/rational.c
AgeCommit message (Collapse)Author
2009-07-25* complex.c (nucomp_hash), rational.c (nurat_hash): not to usenobu
hash value of class so that equality against subclasses can work. [ruby-dev:38850] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 * rational.c (float_to_r): an improvement.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-19 * complex.c (make_patterns): do not use \d.tadf
* rational.c (make_patterns): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-12 * complex.c: added some shortcuts.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-12 * complex.c: use k_exact_{zero,one}_p macro.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-12 * numeric.c (fix_divide): added an entry to rational.tadf
* 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
2009-07-05 * rational.c: edited rdoc.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-03 * rational.c: renamed equal_p to eqeq_p.tadf
* complex.c: ditto. * complex.c (nucomp_equal_p): added. Complex(NaN).equal?(Complex(NaN)) should return true. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-29added a comment.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-29 * rational.c (float_to_r): always returns rational.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-28 * complex.c (nucomp_div): raises ZeroDivisionError immediatelytadf
when the given second argument is zero. * rational.c (nurat_fdiv): never raise even if the given second argument is zero. * rational.c (rb_raise_zerodiv): changed the message (zero to 0). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-28 * complex.c (nucomp_expt): convert to a float when the given powertadf
is a bignum. * rational.c (nurat_expt): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-28 * complex.c (nucomp_expt): some improvements.tadf
* rational.c (nurat_expt): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-28 * complex.c: renamed some static functions.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-27 * rational.c (nurat_cmp): use rb_num_coerce_cmp.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-27 * complex.c: revised rdoc.tadf
* rational.c: ditto. * numeric.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-20 * numeric.c (num_div): don't use num_floor which is actuallytadf
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
2009-06-19 * complex.c: edited rdoc.tadf
* rational.c: ditto. * numeric.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19 * complex.c: edited rdoc.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19 * complex.c; edited rdoc.tadf
* rational.c; ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19 * rational.c (nurat_abs); removed.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19 * rational.c; edited rdoc.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19due to conflicttadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19 * complex.c: constant COMPLEX_NAME has been removed.tadf
* rational.c: constant RATIONAL_NAME has been removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19 * rational.c: added rdoc. a patch from Run Paint Run Run.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-19 * numeric.c (*_numerator,*_denominator): moved to rational.c.tadf
* 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
2009-06-18 * rational.c (nurat_s_convert): calls to_r when the given argumenttadf
is non-integer. * rational.c (nurat_s_convert): raises TypeError when the given argument is nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-17 * rational.c (nurat_coerce): accepts Complex when the imag istadf
exact zero. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-17 * bignum.c (rb_big_fdiv): checks whether the given second argumenttadf
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
2009-06-16 * complex.c (nucomp_coerce): accepts Complex instances.tadf
* rational.c (nurat_coerce): accepts Rational instances. [ruby-core:23859] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13 * complex.c (nucomp_fdiv): use fdiv recursively.tadf
* complex.c (nucomp_expt): reduced code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-13 * rational.c (nurat_to_f): use fdiv.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14* string.c (rb_hash_uint32, rb_hash_uint, rb_hash_start, rb_hash_end),mame
include/ruby/intern.h: add Murmurhash API. [ruby-dev:37784] * complex.c (nucomp_hash), array.c (rb_ary_hash), time.c (time_hash), string.c (rb_str_hsah), object.c (rb_obj_hash), range.c (range_hash), struct.c (rb_struct_hash), hash.c (rb_any_hash), rational.c (nurat_hash): use Murmurhash. [ruby-dev:37784] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 * bignum.c (rb_cstr_to_inum): changed an error message.tadf
* complex.c (string_to_c_strict): ditto. * rational.c (string_to_r_strict): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 * rational.c: floor, ceil, truncate and round accept an extratadf
argument like Float#round. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-13 * complex.c: use rb_usascii_str_new2 instead of rb_str_new2.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-12 * complex.c (nucomp_canonicalization): renamed.tadf
* ext/math/complex.c: followed the above change. * rational.c (nurat_canonicalization): renamed. * ext/math/rational.c: followed the above change. * configure.in: defines a new macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-12 * complex.c, rational.c: do not use RUBY_VERSION_CODE.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-12* complex.c, rational.c: do not use RUBY_VERSION_CODE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-10 * complex.c: avoided warnings on cpp.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-05 * rational.c (nurat_{to_s,inspect}): performance improvement.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20547 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 * complex.c: continues to support canonicalization *unofficially*tadf
for an odd library mathn for the time being (only 1.9.x). since grand mathn is must be very very special library for us. * rational.c: ditto. * ext/mathn/*/*: follow the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* complex.c (Init_Complex), rational.c (Init_Rational): undefinesnobu
default #allocate methods which call the allocater. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* complex.c (Init_Complex), rational.c (Init_Rational): ID_ALLOCATORnobu
differs from :allocate, and invisible in ruby level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 * complex.c (nucomp_s_canonicalize_internal): does no applytadf
canonicalization rule anymore. * rational.c (nurat_s_canonicalize_internal(_no_reduce)?): ditto. * complex.c: removed class method new! and new. * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-21 * complex.c: added two macros.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-21 * complex.c (nucomp_s_convert): checks argc.tadf
* rational.c (nurat_s_convert): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-21 * complex.c (nucomp_s_canonicalize_internal): checks exactness oftadf
imag only. * rational.c (nurat_s_convert): accepts non real value (Rational(a,b) as a/b). * complex.c (nucomp_s_convert): refined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-20 * complex.c: an instance method image has been removed andtadf
uses "imag" instead of "image". * complex.c: two instance method re and im are removed. * rational.c: follows the above changes. * include/ruby/ruby.h: ditto. * gc.c: ditto. * lib/cmath.rb: ditto. * lib/mathn.rb: ditto. * lib/complex.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-19 * complex.c: uses f_(in)?exact_p macro.tadf
* rational.c: ditto. * bignum.c (rb_big_pow): bignum**bignum - should calculate without rational. * lib/complex.rb: should override Math module at most once. * lib/mathn.rb: requires 'cmath' directly. -この行以下は無視されます -- M complex.c M ChangeLog M lib/mathn.rb M lib/complex.rb M bignum.c M rational.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e