aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rational.rb
Commit message (Collapse)AuthorAgeFilesLines
* * lib/mathn.rb (Bignum#**): Fixed bignum**fixnum that was broken when ↵marcandre2009-09-241-2/+2
| | | | | | | | requiring lib/mathn [ruby-core:25740] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* warn only when $VERBOSE.tadf2009-08-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/complex.rb, lib/rational.rb: added warning messages.tadf2009-08-161-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: edited rdoc.tadf2009-06-191-0/+2
| | | | | | | | * rational.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb: resolved conflicts of aliases.tadf2008-10-051-2/+2
| | | | | | | | * lib/mathn.rb: avoided some warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* trivial change.tadf2008-04-071-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cmath.rb: new.tadf2008-04-051-0/+2
| | | | | | | | | | | | * 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
* revert git backfire in r15860; sorrymatz2008-03-301-32/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * proc.c (proc_dup): should copy is_lambda attribute as well.matz2008-03-301-0/+32
| | | | | | [ruby-talk:296244] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (f_lcm): removed.tadf2008-03-271-32/+0
| | | | | | | | | | | | * rational.c (rb_lcm, rb_gcdlcm): added. * lib/complex.rb (gcd, lcm, gcdlcm): removed. * lib/rational.rb (gcd, lcm, gcdlcm): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* both complex and rational are now builtin classes.tadf2008-03-161-518/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb (floor, ceil, truncate, round): do not usetadf2008-02-121-22/+53
| | | | | | | | | | | | | | | | | | | | definitions of Numeric. * lib/rational.rb (to_i): should returns truncated self. * lib/complex.rb (numerator): requires Integer#{numerator,denominator}. * lib/complex.rb (quo): do not use definition of Numeric. * lib/complex.rb (>, >=, <, <=, between?, div, divmod, modulo, floor, ceil, truncate, round): undef'ed. * lib/mathn.rb (Rational#inspect): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * $Date$ keyword removed to avoid inclusion of locale dependentakr2008-01-061-1/+0
| | | | | | | string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb: fix high-precision Rationals cannot bekeiju2007-05-081-1/+3
| | | | | | | | | converted to Floats. [ruby-Bugs:10502], [ruby-core:11069], [ruby-dev:30743] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb (Integer::gcd): small typo fix. [ruby-core:07395]matz2006-02-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/httpservlet/cgihandler.rb (WEBrick::HTTPServlet::CGIHandler):matz2006-02-201-33/+7
| | | | | | | | | | qualify the access for Config constant. [ruby-dev:28338] * lib/resolv.rb (Resolv::DNS::Resource::IN::A): qualify ClassValue. [ruby-dev:28338] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (scan_once): wrong condition to use mbclen2().matz2005-10-271-58/+233
| | | | | | | | | | [ruby-dev:27535] * time.c (time_sunday): added predicate methods for the days of the week. [ruby-list:41340] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb (Fixnum): remove debug print.matz2005-09-191-6/+0
| | | | | | | * lib/rational.rb (Rational): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_close): call rb_io_close() directly if io is a T_FILEmatz2005-09-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | object. [ruby-dev:27156] * file.c (file_expand_path): allow pathnames to expand. [ruby-dev:27152] * numeric.c (Init_Numeric): should define Fixnum#div. [ruby-dev:27129] * file.c (rb_thread_flock): wrap flock(2) by TRAP_BEG and TRAP_END. [ruby-dev:27122] * file.c (rb_file_join): call FilePathValue() to all Pathnames to join. [ruby-dev:27127] * file.c (rb_get_path): call StringValueCStr() to ensure no nul bytes in path strings. * gc.c (garbage_collect): need value for return. [ruby-dev:27127] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_update): pedantic check to detectmatz2004-11-151-11/+13
| | | | | | | rb_ary_to_ary() to modify the receiver. [ruby-dev:24861] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * exception message clean-up by Ian Macdonald <ian@caliban.org>.matz2004-03-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_clear_cache_by_class): check both klass and origin.matz2003-07-171-6/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb (Integer::denominator): fixed typo. (ruby-bugs-ja:PR#466)nobu2003-05-161-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regex.c (re_match_exec): \Z changed to be consistent with new $matz2003-05-141-1/+1
| | | | | | | (endbuf) behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_ljust): now takes optional argument to specifymatz2003-05-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | pad string. [ruby-talk:70482] * string.c (rb_str_rjust): ditto. * string.c (rb_str_center): ditto. * string.c (rb_str_justify): utility function. * eval.c (rb_add_method): call singleton_method_added or method_added for every method definition (after ruby_running). [ruby-talk:70471] * array.c (rb_ary_reverse_bang): Array#reverse! should not return nil even for arrays sized less than 2. * io.c (argf_eof): should not block after reading all argument files. (ruby-bugs-ja PR#449) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (arg_ambiguous): hopefully better message.matz2003-04-221-1/+3
| | | | | | | * lib/cgi.rb (CGI::QueryExtension::initialize_query): to_ary git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/complex.rb (Complex#==): should not raise error by typematz2003-02-061-7/+21
| | | | | | | | | mismatch. * lib/rational.rb (Rational#==): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): do not warn discarding already undefinedmatz2003-01-231-1/+3
| | | | | | | | | method. * lib/rational.rb: undef quo before replacing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb: modified to support "quo".matz2003-01-231-37/+6
| | | | | | | | | | * numeric.c (num_quo): should return most exact quotient value, i.e. float by default, rational if available. * numeric.c (num_div): "div" should return x.divmod(x)[0]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb(Rational#hash): modify algorism for hash-function.keiju2002-08-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): ruby_frame->last_func may be null, if it'smatz2002-06-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | called outside of a method. * parse.y (arg): use INT2NUM, not INT2FIX for tUMINUS. * parse.y (arg): unnecessary negative tPOW treatment. * parse.y (tokadd_escape): wrong backslash escapement. * parse.y (stmt,arg): too much void value check. * parse.y (stmt,arg): need to check void value on rules which does not use node_assign(). * ext/socket/socket.c (ipaddr): need not to taint hostnames. * range.c (range_include): should be based on "<=>", whereas member? still is based on "each". * range.c (range_min,range_max): redefine methods based on "<=>". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* regexp literal (e.g. \202) match, etc.matz1999-09-011-5/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 1.4.0matz1999-08-131-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* This commit was generated by cvs2svn to compensate for changes in r372,matz1999-01-201-2/+7
| | | | | | | which included commits to RCS files with non-trunk default branches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Initial revisionv1_0_r2matz1998-01-161-0/+361
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2 b2dd03c8-39d4-4d8f-98ff-823fe69b080e