summaryrefslogtreecommitdiff
path: root/rational.c
AgeCommit message (Collapse)Author
2013-02-23* array.c: Document #<=> return values and formattingzzak
* bignum.c: ditto * file.c: ditto * object.c: ditto * numeric.c: ditto * rational.c: ditto * string.c: ditto * time.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05* rational.c (nurat_expt): Deal with special cases for rationals 0, ±1marcandre
[bug #5713] [bug #5715] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-26marshal.c: marshal_dump instance varialbesnobu
* marshal.c (w_object): dump instance varialbes of the result of marshal_dump not the original object. [ruby-core:51163] [Bug #7627] * complex.c (nucomp_marshal_dump): need to copy instance variables. * rational.c (nurat_marshal_dump): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15 * rational.c (f_round_common): should check overflow.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-15 * ratioanl.c (float_rationalize): reduced.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-03random.c, rational.c: make marshal methods privatenobu
* random.c (Init_Random), rational.c (Init_Rational): make marshal methods private. [Feature #6539] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-22 * complex.c (string_to_c_strict, string_to_c): check NUL.tadf
* rational.c (string_to_r_strict, string_to_r): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-21 * rational.c (read_digits): due to a bit tighter rb_cstr_to_inum().tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20 * complex.c: some improvements.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18 * complex.c (read_comp): mathn compliant.tadf
* rational.c (read_num): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-18trivial changes.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-17 * complex.c (string_to_c_strict, string_to_c): rewrote without regexp.tadf
* 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
2012-11-10 * complex.c: modified doc.tadf
* ratioanl.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-03 * complex.c: modified doc.tadf
* rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-20* include/ruby/ruby.h: add C APIs.nari
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
2012-07-25complex.c, rational.c: compatible marshal loadernobu
* 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
2012-06-03 * marshal.c: experimental test aborted.tadf
* 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
2012-06-03 * marshal.c: calls directly rb_{Complex,Rational}_marshal_load().tadf
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
2012-06-03use rb_marshal_{dump,load}nobu
* 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
2012-06-03 * complex.c: wrote Complex#_dump and Complex::load. But nowtadf
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
2012-06-03 * complex.c (nucomp_marshal_load): [ruby-core:45394]tadf
* rational.c (nurat_marshal_load): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25* complex.c (nucomp_marshal_load): raise error on invalid data.naruse
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
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-17* rational.c (nurat_coerce): Rational#coerce should converts itselfmrkn
into Complex if the argument is a Complex with non-zero imaginary part. [Bug #5020] [ruby-dev:44088] * test/ruby/test_rational.rb (test_coerce): test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* 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
2011-06-09 * complex.c (string_to_c_internal): uses rb_reg_nth_match;tadf
* rational.c (string_to_r_internal): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09 * rational.c (string_to_r): Rational#** may return flonum.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-30* insns.def (opt_mult): as r31805, volatile it.naruse
Without this, clang -O fails calculation. * numeric.c (fix_mul): ditto. * rational.c (f_imul): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-24 * complex.c, rational.c: omitted some method calls.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-26* rational.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-23modified some descriptions.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-22 * complex.c, rational.c ({nucomp,nurat}_expt): added a check.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-14* configure.in, include/ruby/defines.h (RUBY_FUNC_EXPORTED): macronobu
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
2010-08-06* rational.c (nurat_div): divided by infinity should be zero.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-06* rational.c (nurat_div): divided by float zero should benobu
infinity. [ruby-core:31626] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-05* complex.c (nucomp_marshal_load): should check the argument.nobu
[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
2010-08-03* bignum.c (rb_big_eq): never equal to infinity.nobu
[ruby-core:31603] * rational.c (nurat_div): hack for integral float divisor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22* include/ruby/{intern,io}.h: add missing prototypes.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-26 * complex.c, rational.c, lib/cmath.rb, lib/date.rb lib/date/delta*:tadf
reverted r27484-27486. now official spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-25 * complex.c, ratioanl.c: reverted experimental r24565.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-03* complex.c (nucomp_real_check): raise TypeError instead of ArgumentErrormarcandre
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
2010-02-25* rational.c (nurat_expt): use Float#** when Rational ** Float.naruse
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
2009-11-03fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* include/ruby/st.h (st_hash_func): use st_index_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16 * complex.c (nucomp_rationalize) added. [experimental]tadf
* 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
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