aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mathn.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Feature #12005] Unify Fixnum and Bignum into Integerakr2016-05-171-16/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [Feature #12005] Unify Fixnum and Bignum into Integer * include/ruby/ruby.h (rb_class_of): Return rb_cInteger for fixnums. * insns.def (INTEGER_REDEFINED_OP_FLAG): Unified from FIXNUM_REDEFINED_OP_FLAG and BIGNUM_REDEFINED_OP_FLAG. * vm_core.h: Ditto. * vm_insnhelper.c (opt_eq_func): Use INTEGER_REDEFINED_OP_FLAG instead of FIXNUM_REDEFINED_OP_FLAG. * vm.c (vm_redefinition_check_flag): Use rb_cInteger instead of rb_cFixnum and rb_cBignum. (C): Use Integer instead of Fixnum and Bignum. * numeric.c (fix_succ): Removed. (Init_Numeric): Define Fixnum as Integer. * bignum.c (bignew): Use rb_cInteger instead of Rb_cBignum. (rb_int_coerce): replaced from rb_big_coerce and return fixnums as-is. (Init_Bignum): Define Bignum as Integer. Don't define ===. * error.c (builtin_class_name): Return "Integer" for fixnums. * sprintf.c (ruby__sfvextra): Use rb_cInteger instead of rb_cFixnum. * ext/-test-/testutil: New directory to test. Currently it provides utilities for fixnum and bignum. * ext/json/generator/generator.c: Define mInteger_to_json. * lib/mathn.rb (Fixnum#/): Redefinition removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Define Integer#/ instead of Bignum#/.akr2016-04-301-1/+1
| | | | | | | | | | | | * numeric.c (rb_int_div): Define Integer#/. * bignum.c (rb_big_div): Don't define Bignum#/. * lib/mathn.rb (Integer#/): Replace Integer#/ instead of Bignum#/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mathn.rb: remove built-in methodsnobu2014-08-261-136/+7
| | | | | | | * lib/mathn.rb (Fixnum#**, Bignum#**, Float#**, Rational#**): remove as these are now built-in. [ruby-core:63973] [Bug #10086] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: mathn library is deprecated on ruby 2.2.hsbt2014-08-261-0/+2
| | | | | | [Feature #10169][ruby-core:64553] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: removed commented-out code.hsbt2014-08-261-6/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/pathname/lib/pathname.rb: Fix typos and grammar mistakes. Patchdrbrain2011-08-261-8/+8
| | | | | | | | | | | | | | | | by Luke Gruber. [#5203] * ext/pty/lib/expect.rb: ditto * lib/mathn.rb: ditto * lib/net/http.rb: ditto * lib/open-uri.rb: ditto * lib/ostruct.rb: ditto * lib/tempfile.rb: ditto * lib/thread.rb: ditto * lib/weakref.rb: ditto * sample/webrick/httpproxy.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * math.c: Attach documentation for Math.drbrain2011-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | * object.c: Document NIL, TRUE, FALSE. * io.c: Improve grammar in ARGF comment. Document STDIN/OUT/ERR. Document ARGF global constant. * lib/rake: Hide deprecated toplevel constants from RDoc (import from rake trunk). * lib/thwait.rb: Document ThWait. * lib/mathn.rb: Hide Math redefinition from RDoc * lib/sync.rb: Add a basic comment for Sync_m, Synchronizer_m, Sync, Synchronizer. * parse.y: Document SCRIPT_LINES__. * hash.c: Document ENV class and global constant. * vm.c: Document TOPLEVEL_BINDING. * version.c: Document RUBY_* constants. * ruby.c: Document DATA and ARGV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: Improve documentation and attach it to Numeric.drbrain2011-06-011-21/+23
| | | | | | | Modified from patch by Anil V. [Ruby 1.9 - Bug #4762] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: Improve documentation. Patch by Sandor Szucs.drbrain2011-05-231-9/+95
| | | | | | | [Ruby 1.9 - Bug #4767] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: Fix indentation. Patch by Jason Dew.drbrain2011-05-121-47/+50
| | | | | | | [Ruby 1.9 - Feature #4682] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: Add documentation. Patch by Jason Dew. [Ruby 1.9 -drbrain2011-05-121-6/+29
| | | | | | | Feature #4667] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix.rb: suppress warnings.akr2010-01-251-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 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
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-13/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: Math.sqrt(NaN) should be NaN. [ruby-dev:37537]yugui2008-12-231-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: moved into ext/mathn/rational/rational.c andkeiju2008-10-241-95/+3
| | | | | | | | | ext/mathn/complex/complex.c. * ext/mathn: new mathn ext-libralies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rational.rb: resolved conflicts of aliases.tadf2008-10-051-7/+7
| | | | | | | | * lib/mathn.rb: avoided some warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* moved def_canon.tadf2008-09-291-15/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: added String#to_[rc].tadf2008-09-291-4/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb ({Fixnum,Bignum,Float}#**): may produce complextadf2008-09-281-0/+30
| | | | | | | | value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb: a hack to provide canonicalization. This must betadf2008-09-271-0/+90
| | | | | | | | temporary, but this seems to be not bad for the time being. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: an instance method image has been removed andtadf2008-09-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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
* * complex.c: uses f_(in)?exact_p macro.tadf2008-09-191-2/+6
| | | | | | | | | | | | | | | | | | | | | | | * 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
* * lib/mathn.rb (Integer): moved into prime.rb.yugui2008-09-031-95/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Prime): ditto. * lib/prime.rb (Integer): moved from mathn.rb. (Integer.each_prime): added. (Integer#prime?): added. (Prime): moved from mathn.rb. Its implmentation was rewritten. see [ruby-dev:35863]. And patched by Keiju ISHITSUKA <keiju@ishitsuka.com>, see [ruby-dev:36128]. (Prime.new): obsolete. (Prime.instance): added. (Prime.each): added. (Prime.int_from_prime_division): added. (Prime.prime_division): added. (Prime.prime?): added. Patch by TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36067]. (Prime.cache): removed. (Prime.primes): removed. (Prime.primes_so_far): removed. (Prime#int_from_prime_division): added. (Prime#prime_division): added. (Prime#prime?): added. (Prime#primes): removed. (Prime#primes_so_far): removed. (Prime::PseudoPrmeGenerator): added. (Prime::EratosthenesGenerator): added. (Prime::TrialDivisionGenerator): added. (Prime::Generator23): added. (Prime::TrialDivision): added. Extracted from the previous implementation of Prime by Keiju ISHITSUKA. (Prime::EratosthenesSieve): added. * lib/.document (prime.rb): added * lib/README (prime.rb): added * test/test_prime.rb: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb (Rational::power2): removed incomplete method.matz2008-06-231-44/+0
| | | | | | see [ruby-dev:35195]. [ruby-core:17293] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb (Rational::power2): typo fixed. [ruby-core:17293]matz2008-06-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* both complex and rational are now builtin classes.tadf2008-03-161-5/+4
| | | | 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-5/+0
| | | | | | | | | | | | | | | | | | | | 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
* * lib/mathn.rb (Prime#each): returns an enumerator if no blockkazu2008-01-091-0/+1
| | | | | | | given. [ruby-dev:32815] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14970 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
* * ext/socket/socket.c (unix_sysaccept): typo fixed.matz2006-06-191-0/+1
| | | | | | | | * ext/socket/socket.c (sock_connect): remove an unused local variable tmpaddr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * sprintf.c (rb_str_format): allow %c to print one charactermatz2006-06-091-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | string (e.g. ?x). * lib/tempfile.rb (Tempfile::make_tmpname): put dot between basename and pid. [ruby-talk:196272] * parse.y (do_block): remove -> style block. * parse.y (parser_yylex): remove tLAMBDA_ARG. * eval.c (rb_call0): binding for the return event hook should have consistent scope. [ruby-core:07928] * eval.c (proc_invoke): return behavior should depend whether it is surrounded by a lambda or a mere block. * eval.c (formal_assign): handles post splat arguments. * eval.c (rb_call0): ditto. * st.c (strhash): use FNV-1a hash. * parse.y (parser_yylex): removed experimental ';;' terminator. * eval.c (rb_node_arity): should be aware of post splat arguments. * eval.c (rb_proc_arity): ditto. * parse.y (f_args): syntax rule enhanced to support arguments after the splat. * parse.y (block_param): ditto for block parameters. * parse.y (f_post_arg): mandatory formal arguments after the splat argument. * parse.y (new_args_gen): generate nodes for mandatory formal arguments after the splat argument. * eval.c (rb_eval): dispatch mandatory formal arguments after the splat argument. * parse.y (args): allow more than one splat in the argument list. * parse.y (method_call): allow aref [] to accept all kind of method argument, including assocs, splat, and block argument. * eval.c (SETUP_ARGS0): prepare block argument as well. * lib/mathn.rb (Integer): remove Integer#gcd2. [ruby-core:07931] * eval.c (error_line): print receivers true/false/nil specially. * eval.c (rb_proc_yield): handles parameters in yield semantics. * eval.c (nil_yield): gives LocalJumpError to denote no block error. * io.c (rb_io_getc): now takes one-character string. * string.c (rb_str_hash): use FNV-1a hash from Fowler/Noll/Vo hashing algorithm. * string.c (rb_str_aref): str[0] now returns 1 character string, instead of a fixnum. [Ruby2] * parse.y (parser_yylex): ?c now returns 1 character string, instead of a fixnum. [Ruby2] * string.c (rb_str_aset): no longer support fixnum insertion. * eval.c (umethod_bind): should not update original class. [ruby-dev:28636] * eval.c (ev_const_get): should support constant access from within instance_eval(). [ruby-dev:28327] * time.c (time_timeval): should round for usec floating number. [ruby-core:07896] * time.c (time_add): ditto. * dir.c (sys_warning): should not call a vararg function rb_sys_warning() indirectly. [ruby-core:07886] * numeric.c (flo_divmod): the first element of Float#divmod should be an integer. [ruby-dev:28589] * test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder. * re.c (rb_reg_initialize): should not allow modifying literal regexps. frozen check moved from rb_reg_initialize_m as well. * re.c (rb_reg_initialize): should not modify untainted objects in safe levels higher than 3. * re.c (rb_memcmp): type change from char* to const void*. * dir.c (dir_close): should not close untainted dir stream. * dir.c (GetDIR): add tainted/frozen check for each dir operation. * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_symbol_arg): typo fixed. a patch from Florian Gross <florg at florg.net>. * eval.c (EXEC_EVENT_HOOK): trace_func may remove itself from event_hooks. no guarantee for arbitrary hook deletion. [ruby-dev:28632] * util.c (ruby_strtod): differ addition to minimize error. [ruby-dev:28619] * util.c (ruby_strtod): should not raise ERANGE when the input string does not have any digits. [ruby-dev:28629] * eval.c (proc_invoke): should restore old ruby_frame->block. thanks to ts <decoux at moulon.inra.fr>. [ruby-core:07833] also fix [ruby-dev:28614] as well. * signal.c (trap): sig should be less then NSIG. Coverity found this bug. a patch from Kevin Tew <tewk at tewk.com>. [ruby-core:07823] * math.c (math_log2): add new method inspired by [ruby-talk:191237]. * math.c (math_log): add optional base argument to Math::log(). [ruby-talk:191308] * ext/syck/emitter.c (syck_scan_scalar): avoid accessing uninitialized array element. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07809] * array.c (rb_ary_fill): initialize local variables first. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07810] * ext/syck/yaml2byte.c (syck_yaml2byte_handler): need to free type_tag. a patch from Pat Eyler <rubypate at gmail.com>. [ruby-core:07808] * ext/socket/socket.c (make_hostent_internal): accept ai_family check from Sam Roberts <sroberts at uniserve.com>. [ruby-core:07691] * util.c (ruby_strtod): should not cut off 18 digits for no reason. [ruby-core:07796] * array.c (rb_ary_fill): internalize local variable "beg" to pacify Coverity. [ruby-core:07770] * pack.c (pack_unpack): now supports CRLF newlines. a patch from <tommy at tmtm.org>. [ruby-dev:28601] * applied code clean-up patch from Stefan Huehner <stefan at huehner.org>. [ruby-core:07764] * lib/jcode.rb (String::tr_s): should have translated non squeezing character sequence (i.e. a character) as well. thanks to Hiroshi Ichikawa <gimite at gimite.ddo.jp> [ruby-list:42090] * ext/socket/socket.c: document update patch from Sam Roberts <sroberts at uniserve.com>. [ruby-core:07701] * lib/mathn.rb (Integer): need not to remove gcd2. a patch from NARUSE, Yui <naruse at airemix.com>. [ruby-dev:28570] * parse.y (arg): too much NEW_LIST() * eval.c (SETUP_ARGS0): remove unnecessary access to nd_alen. * eval.c (rb_eval): use ARGSCAT for NODE_OP_ASGN1. [ruby-dev:28585] * parse.y (arg): use NODE_ARGSCAT for placeholder. * lib/getoptlong.rb (GetoptLong::get): RDoc update patch from mathew <meta at pobox.com>. [ruby-core:07738] * variable.c (rb_const_set): raise error when no target klass is supplied. [ruby-dev:28582] * prec.c (prec_prec_f): documentation patch from <gerardo.santana at gmail.com>. [ruby-core:07689] * bignum.c (rb_big_pow): second operand may be too big even if it's a Fixnum. [ruby-talk:187984] * README.EXT: update symbol description. [ruby-talk:188104] * COPYING: explicitly note GPLv2. [ruby-talk:187922] * parse.y: remove some obsolete syntax rules (unparenthesized method calls in argument list). * eval.c (rb_call0): insecure calling should be checked for non NODE_SCOPE method invocations too. * eval.c (rb_alias): should preserve the current safe level as well as method definition. * process.c (rb_f_sleep): remove RDoc description about SIGALRM which is not valid on the current implementation. [ruby-dev:28464] Thu Mar 23 21:40:47 2006 K.Kosako <sndgk393 AT ybb.ne.jp> * eval.c (method_missing): should support argument splat in super. a bug in combination of super, splat and method_missing. [ruby-talk:185438] * configure.in: Solaris SunPro compiler -rapth patch from <kuwa at labs.fujitsu.com>. [ruby-dev:28443] * configure.in: remove enable_rpath=no for Solaris. [ruby-dev:28440] * ext/win32ole/win32ole.c (ole_val2olevariantdata): change behavior of converting OLE Variant object with VT_ARRAY|VT_UI1 and Ruby String object. * ruby.1: a clarification patch from David Lutterkort <dlutter at redhat.com>. [ruby-core:7508] * lib/rdoc/ri/ri_paths.rb (RI::Paths): adding paths from rubygems directories. a patch from Eric Hodel <drbrain at segment7.net>. [ruby-core:07423] * eval.c (rb_clear_cache_by_class): clearing wrong cache. * ext/extmk.rb: use :remove_destination to install extension libraries to avoid SEGV. [ruby-dev:28417] * eval.c (rb_thread_fd_writable): should not re-schedule output from KILLED thread (must be error printing). * array.c (rb_ary_flatten_bang): allow specifying recursion level. [ruby-talk:182170] * array.c (rb_ary_flatten): ditto. * gc.c (add_heap): a heap_slots may overflow. a patch from Stefan Weil <weil at mail.berlios.de>. * eval.c (rb_call): use separate cache for fcall/vcall invocation. * eval.c (rb_eval): NODE_FCALL, NODE_VCALL can call local functions. * eval.c (rb_mod_local): a new method to specify newly added visibility "local". * eval.c (search_method): search for local methods which are visible only from the current class. * class.c (rb_class_local_methods): a method to list local methods. * object.c (Init_Object): add BasicObject class as a top level BlankSlate class. * ruby.h (SYM2ID): should not cast to signed long. [ruby-core:07414] * class.c (rb_include_module): allow module duplication. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb (Fixnum): remove debug print.matz2005-09-191-3/+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-1/+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
* * lib/mathn.rb (Rational::inspect): should preserve originalmatz2005-09-171-2/+3
| | | | | | | operand. [ruby-core:05806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_clear): avoid revealing NULL pointer.matz2004-11-141-38/+47
| | | | | | | | | | | | | | | | | | [ruby-dev:24766] * string.c (str_gsub): add paranoid check. [ruby-dev:24827] * string.c (str_mod_check): check frozen status as well. [ruby-dev:24801] * lib/mathn.rb (Integer::gcd2): faster implementation by <erlercw@siu.edu>. [ruby-talk:120232] * ext/gdbm/gdbm.c (fgdbm_store): StringValue() may alter string pointer. [ruby-dev:24783] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_fopen): mode string copy at the lowest level.matz2004-10-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | * io.c (rb_io_flags_mode): requires output buffer no more. no allocation needed. * array.c (rb_ary_index): takes a block to compare items in an array. [ruby-talk:113069] [Ruby2] * array.c (rb_ary_rindex): ditto. * marshal.c (r_byte): retrieve pointer from string value for each time. [ruby-dev:24404] * marshal.c (r_bytes0): ditto. * enum.c (sort_by_i): re-entrance check added. [ruby-dev:24399] * io.c (io_read): should freeze all reading buffer. [ruby-dev:24400] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * misc/ruby-mode.el (ruby-calculate-indent): proper indentationmatz2003-12-191-1/+1
| | | | | | | | | | inside of parentheses. [ruby-dev:22308] * hash.c (delete_if_i): do not use ST_DELETE for thread safety. [ruby-dev:21899] (not fully solved) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/socket.c (tcp_s_gethostbyname): was usingmatz2003-07-251-11/+11
| | | | | | | | | uninitialized size_t value. [ruby-talk:76946] * Minor cleanups. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_ljust): now takes optional argument to specifymatz2003-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* * lib/rational.rb: modified to support "quo".matz2003-01-231-9/+2
| | | | | | | | | | * 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
* forgot some checkins.matz2001-05-061-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 1.4.0matz1999-08-131-2/+2
| | | | 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/+3
| | | | | | | 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/+308
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2 b2dd03c8-39d4-4d8f-98ff-823fe69b080e