aboutsummaryrefslogtreecommitdiffstats
path: root/complex.c
Commit message (Collapse)AuthorAgeFilesLines
...
* trivial changes.tadf2012-11-181-11/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (read_comp): modified handling of polar form.tadf2012-11-171-5/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (read_comp): fixed handling of polar form.tadf2012-11-171-3/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (string_to_c_strict, string_to_c): rewrote without regexp.tadf2012-11-171-131/+230
| | | | | | | * rational.c (string_to_r_strict, string_to_r): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (make_patterns): should not accept extra sign.tadf2012-11-171-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: modified doc.tadf2012-11-101-3/+7
| | | | | | | * ratioanl.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: modified doc.tadf2012-11-031-35/+94
| | | | | | | * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h: add C APIs.nari2012-10-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VALUE rb_newobj_of(VALUE klass, VALUE flags) #define NEWOBJ_OF(obj,type,klass,flags) These allow to change a allocation strategy depending on klass or flags. * gc.c: ditto * array.c: use new C API. * bignum.c: ditto * class.c: ditto * complex.c: ditto * ext/socket/ancdata.c: ditto * ext/socket/option.c: ditto * hash.c: ditto * io.c: ditto * marshal.c: ditto * numeric.c: ditto * object.c: ditto * random.c: ditto * range.c: ditto * rational.c: ditto * re.c: ditto * string.c: ditto * struct.c: ditto [Feature #7177][Feature #7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: Fix examples of r36993.eregon2012-09-221-7/+5
| | | | | | | Keep the simple definition, mathematics define the result. Based on patch by Robin Dupret. Fixes #188 on github. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove garbages.nobu2012-09-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: Examples for Complex Documentation.zzak2012-09-191-3/+17
| | | | | | | | Patch by Robin Dupret. Fixes #184 on github. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* added a commenttadf2012-08-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* complex.c, rational.c: compatible marshal loadernobu2012-07-251-11/+29
| | | | | | | | * complex.c, rational.c: compatible marshal loader for compatibilities with 1.8. [ruby-core:45775] [Bug #6625] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c: experimental test aborted.tadf2012-06-031-45/+0
| | | | | | | | | * complex.c: ditto. * rational.c: ditto. * include/ruby/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * marshal.c: calls directly rb_{Complex,Rational}_marshal_load().tadf2012-06-031-0/+20
| | | | | | | | | | But now disabled. [experimental] * complex.c: followed the above. * rational.c: ditto. * include/rub/intern.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use rb_marshal_{dump,load}nobu2012-06-031-8/+4
| | | | | | | | * marshal.c: revert r35879 "now marshal_{load|dump} are external." * complex.c (nucomp_marshal__{dump,load}): should use rb_marshal_{dump,load}. * rational.c (nurat_marshal__{dump,load}): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: wrote Complex#_dump and Complex::load. But nowtadf2012-06-031-0/+29
| | | | | | | | | disabled (due to compatibility) [experimental]. * rational.c: wrote Rational#_dump and Rational::load. ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_marshal_load): [ruby-core:45394]tadf2012-06-031-0/+4
| | | | | | | * rational.c (nurat_marshal_load): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_expt): [ruby-core:44170].tadf2012-04-081-4/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_expt): the result of f_complex_new2 may be a fixnumnaruse2012-04-081-2/+5
| | | | | | with mathn. [ruby-core:44170] [Bug #6267] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* replaced rdoc for Complex::Itadf2012-02-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_marshal_load): raise error on invalid data.naruse2012-02-251-0/+2
| | | | | | reported by John Firebaugh [ruby-core:42860] [Bug #6076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (Init_Complex): Document Complex::I. Patch by Sylvaindrbrain2012-02-241-0/+3
| | | | | | | Daubert. [Feature #5623] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_rationalize): fix function. [ruby-core:40667]nobu2011-11-021-1/+1
| | | | | | [Bug #5546] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: use "__sun" instead of "__sun__" to detect SunOS.akr2011-10-241-1/+1
| | | | | | | | | | | | | | | | * math.c: ditto. * hash.c: ditto. * atomic.h: ditto. * ext/io/wait/wait.c: ditto. [ruby-dev:44693] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-5/+5
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_rationalize): calls rationalize of real part ifmrkn2011-08-101-4/+13
| | | | | | | | | | | imaginary part is exactly zero. The patch is made by Marc-Andre Lafortune. fixes [Bug #5178] [ruby-core:38885] * test/ruby/test_complex.rb (test_rationalize): add a test for the above change. * complex.c (nucomp_to_r): fix RDoc comment. The patch is made by Marc-Andre Lafortune. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (f_signbit): fix compile error in gcc4 on Solaris withngoto2011-08-051-2/+3
| | | | | | | | | CFLAGS="-std=gnu99". [ruby-dev:44355] fix [Bug #5159] * math.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Forward-ports r32777 from branches/ruby_1_9_3 to trunk.yugui2011-07-311-0/+3
| | | | | | | | | | -- * complex.c (f_signbit): gcc4 on Solaris DOES have signbit but does not have it on header. * math.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: added declarations.tadf2011-07-091-2/+0
| | | | | | | * complex.c: followed the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * internal.h: declare internal functions here.akr2011-06-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (string_to_c_internal): uses rb_reg_nth_match;tadf2011-06-091-18/+12
| | | | | | | | * rational.c (string_to_r_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (string_to_c_internal): a refactoring.tadf2011-05-091-3/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (string_to_c_internal): support scientific notation.mrkn2011-05-091-2/+3
| | | | | | | patched by Tinco Andringa. https://github.com/ruby/ruby/pull/16 [ruby-core:36046][Bug #4655] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c, rational.c: omitted some method calls.tadf2011-04-241-16/+20
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 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