summaryrefslogtreecommitdiff
path: root/rational.c
AgeCommit message (Collapse)Author
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
2008-09-19* prec.c: removed. Precision will be redesigned and be back again.yugui
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: svn+ssh://ci.ruby-lang.org/ruby/trunk@19430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-17 * complex.c (nucomp_s_convert): accepts complextadf
value (Complex(a,b) as a+bi). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-16 * complex.c (nucomp_marshal_{dump,load}): preserve instancetadf
variables. * rational.c (nurat_marshal_{dump,load}): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15* gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko1
to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15fixed the previous commit.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15 * complex.c (nucomp_eql_p): new.tadf
* complex.c (nucomp_hash): should use hash values of the elements. * rational.c (nurat_hash): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-14 * complex.c: trivial changes.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-14 * complex.c (f_{add,mul,sub}): omitted some shortcuts for preservetadf
signed zero anyway. * complex.c (nucomp_negate): new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13 * complex.c: refined.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-07 * complex.c: some adjustments.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-07 * rational.c: removed unused code.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-30 * rational.c: added a static variable for nurat_to_f.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29 * complex.c ({nucomp,numeric}_rect): new.tadf
* complex.c: added some aliases (::rectangular, ::rect, #rectangular, #rect, #phase, #magnitude). * complex.c (string_to_c_internal): should not strip any null bytes. * rational.c (string_to_r_internal): ditto. * rational.c (i_gcd): reverted to nurat 0.0.2's one. * numeric.c: added an alias (#magnitude). * test/ruby/test_complex.rb: added assertions. * test/ruby/test_rational.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 * complex.c (nucomp_div): now behaves as quo.tadf
* complex.c (nucomp_s_generic_p): has been removed. * complex.c (nucomp_to_s): adopts new form. * complex.c (nucomp_inspect): ditto. * complex.c (string_to_c_internal): ditto and supports polar form. * complex.c (rb_complex_polar): new. * rational.c (nurat_to_s): did not canonicalize. * rational.c (nurat_inspect): adopts new form. * rational.c (string_to_r_internal): ditto. * include/ruby/intern.h: added a declaration. * lib/complex.rb: added an obsolate class method. * lib/cmath.rb: use scalar? instead of generic?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-16* include/ruby/ruby.h (rb_intern_const): tiny optimization.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-02* sprintf.c: include ieeefp.h to refer isinf.mame
* ext/bigdecimal/bigdecimal.c: ditto. * ext/json/ext/generator/generator.c: ditto. * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13 * rational.c (nurat_equal_p): Rational(0,x) and 0 are equivalent,tadf
anyway. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13 * complex.c (string_to_c, nucomp_s_convert): preserve the currenttadf
backref. * rational.c (string_to_r, nurat_s_convert): ditto. * include/ruby/intern.h (rb_match_busy): added a declaration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-13* rational.c (string_to_r_internal): save and restore backref. fixed ↵wanabe
[ruby-dev:34990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-12 * complex.c: refactoring.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-10* rational.c (nurat_s_convert): need not to initialize optionalmatz
argument for rb_scan_args(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09fixedtadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09 * complex.c (nucomp_s_convert): can accept Complex('i').tadf
[ruby-dev:34991] and some minor changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.nobu
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* complex.c (make_patterns): constified.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-09* rational.c (make_patterns): constified.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-01* rational.c (string_to_r_internal): use rb_isdigit.naruse
* marshal.c (long_toobig): use %zd. * ruby.c (set_arg0): move unused variable definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07* bignum.c (rb_big_fdiv): flo.fdiv(NaN) should result NaN.matz
* numeric.c (num_quo): renamed and moved from bignum.c. [ruby-dev:34582] * bignum.c (rb_big_fdiv): update RDoc description * rational.c (nurat_s_new_m): small refactoring. * bignum.c (rb_big2dbl): no need for forceful warning when converting to float. overflow is a nature of float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-01* test/ruby/test_parse.rb (TestParse::test_void_expr_stmts_value):matz
shut up warning. * rational.c (nurat_to_f): no need for forceful warning when converting to float. overflow is a nature of float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-28 * rational (nurat_marshal_load): checks the giventadf
denominator. [ruby-dev:34536] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-27 * rational.c (nurat_expt): use f_rational_new2. [ruby-dev:34524]tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22* complex.c, rational.c: fixed indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-05 * lib/cmath.rb: new.tadf
* lib/complex.rb: depends lib/cmath.rb. * lib/rational.rb: added rdiv. * complex.c: removed some math functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03* bignum.c (Init_Bignum): rdiv method removed. [ruby-dev:34242]matz
* complex.c (nucomp_quo): ditto. * numeric.c (num_rdiv): ditto. * rational.c (nurat_div): ditto. * complex.c (nucomp_fdiv): fdiv implementation restored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03 * complex.c (nucomp_int_check): function for DRY real check.tadf
* complex.c (nucomp_{add,sub,mul,div,expt}): use rb_num_coerce_bin(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e