aboutsummaryrefslogtreecommitdiffstats
path: root/complex.c
Commit message (Collapse)AuthorAgeFilesLines
* update doc.akr2011-01-081-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: parenthesize macro arguments.akr2010-12-051-10/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* modified some descriptions.tadf2010-11-231-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c, rational.c ({nucomp,nurat}_expt): added a check.tadf2010-11-221-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in, include/ruby/defines.h (RUBY_FUNC_EXPORTED): macronobu2010-08-141-9/+1
| | | | | | | | | | | to declare exported function. * array.c (rb_ary_memsize), string.c (rb_str_memsize), variable.c (rb_objspace_data_type_memsize): used in objspace. [ruby-dev:42022] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_to_[ifr]): don't allow complex with in-exacttadf2010-08-101-3/+3
| | | | | | | imaginary zero to be converted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_marshal_load): should check the argument.nobu2010-08-051-0/+1
| | | | | | | | | [ruby-core:31622] * rational.c (nurat_marshal_load): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_to_i): allow complex with imaginary zero to bematz2010-07-221-3/+3
| | | | | | | | converted. * complex.c (nucomp_to_f, nucomp_to_r): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/{intern,io}.h: add missing prototypes.nobu2010-07-221-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c, rational.c, lib/cmath.rb, lib/date.rb lib/date/delta*:tadf2010-04-261-0/+15
| | | | | | | | reverted r27484-27486. now official spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c, ratioanl.c: reverted experimental r24565.tadf2010-04-251-15/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (f_signbit): remove condition for signbit becausenaruse2010-03-121-15/+0
| | | | | | all platforms have signbit from r26871. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (m_log, m_exp): remove unused functions.naruse2010-03-041-21/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_real_check): raise TypeError instead of ArgumentErrormarcandre2010-03-031-1/+1
| | | | | | | | when argument is not a real as expected [ruby-core:28395] * rational.c (nurat_int_check): ditto (for integers) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c (nurat_expt): use Float#** when Rational ** Float.naruse2010-02-251-8/+0
| | | | | | | | | This fixes Rational(3,1)**3.0=>26.99999999999999 on FreeBSD. * complex.c (rb_fexpt): removed. Note that this function is not static but is private. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos.akr2009-11-031-4/+4
| | | | 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
* * complex.c (nucomp_rationalize) added. [experimental]tadf2009-08-161-0/+15
| | | | | | | | * rational.c ({nurat,nilclass,integer,float}_rationalize) ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (num_imaginary): num#i to return imaginary counterpartmatz2009-08-161-0/+1
| | | | | | | | 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
* * complex.c (nucomp_hash), rational.c (nurat_hash): not to usenobu2009-07-251-4/+3
| | | | | | | | 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
* * complex.c (make_patterns): do not use \d.tadf2009-07-191-1/+1
| | | | | | | * rational.c (make_patterns): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: added some shortcuts.tadf2009-07-121-10/+38
| | | | | | | * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: use k_exact_{zero,one}_p macro.tadf2009-07-121-11/+10
| | | | | | | * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_divide): added an entry to rational.tadf2009-07-121-1/+7
| | | | | | | | | * 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
* * complex.c (nucomp_div): omitted zero division check.tadf2009-07-081-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_s_polar): now arg is optional.tadf2009-07-051-4/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (float_arg): returns PI for -0.0.tadf2009-07-051-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* added examples.tadf2009-07-031-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_equal_p): removed.tadf2009-07-031-31/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c: renamed equal_p to eqeq_p.tadf2009-07-031-11/+39
| | | | | | | | | | | * 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
* * complex.c: undef-ed shome methods. [ruby-core:24110]tadf2009-07-031-3/+26
| | | | | | | | * complex.c (Numeric#arg): NaN for NaN. [ruby-core:24116] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_expt): do not use rb_fexpt.tadf2009-06-291-9/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_expt): checks exactness.tadf2009-06-291-11/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_div): raises ZeroDivisionError immediatelytadf2009-06-281-0/+4
| | | | | | | | | | | | | 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
* * complex.c (nucomp_expt): convert to a float when the given powertadf2009-06-281-2/+17
| | | | | | | | | | 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
* * complex.c (nucomp_expt): some improvements.tadf2009-06-281-1/+47
| | | | | | | | * rational.c (nurat_expt): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: renamed some static functions.tadf2009-06-281-13/+13
| | | | | | | | * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* trivial change.tadf2009-06-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_addsub): newtadf2009-06-271-39/+66
| | | | | | | | | | | | * complex.c (nucomp_{add,sub}): use nucomp_addsub. * complex.c (nucomp_divide): changed the algorithm. * complex.c (nucomp_abs): added shortcuts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: revised rdoc.tadf2009-06-271-97/+130
| | | | | | | | | | * rational.c: ditto. * numeric.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: edited rdoc.tadf2009-06-201-0/+13
| | | | | | | | * 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-17/+17
| | | | | | | | | | * 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-22/+22
| | | | | | | | * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c; edited rdoc.tadf2009-06-191-4/+18
| | | | | | | | * rational.c; ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: added rdoc.tadf2009-06-191-0/+259
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: constant COMPLEX_NAME has been removed.tadf2009-06-191-6/+2
| | | | | | | | * 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
* * rational.c (nurat_s_convert): calls to_r when the given argumenttadf2009-06-181-0/+6
| | | | | | | | | | | 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
* * complex.c (nucomp_coerce): accepts Complex instances.tadf2009-06-161-0/+2
| | | | | | | | | * 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
* * complex.c (nucomp_fdiv): use fdiv recursively.tadf2009-06-131-36/+33
| | | | | | | | * complex.c (nucomp_expt): reduced code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (f_signbit): fixed indentation.nobu2009-02-151-12/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e