summaryrefslogtreecommitdiff
path: root/random.c
AgeCommit message (Collapse)Author
2011-05-15* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-25* random.c (random_rand): remove unused variables.naruse
* struct.c (rb_struct_define_without_accessor): ditto. * strftime.c (rb_strftime_with_timespec): ditto. * sprintf.c: ditto. * time.c (time_asctime): remove useless GetTimeval(). * thread_pthread.c: cast to (void *) for %p. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-24* random.c (rb_f_rand, random_s_rand): RDocs for them.sorah
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-24* random.c (random_s_rand, Init_Random): Random.rand should behave asmrkn
Random::DEFAULT.rand rather than Kernel#rand. * random.c (rand_range, random_rand): rand_range function extracted from random_rand function. * random.c (rb_f_rand): accept a Range argument as Random#rand [ruby-dev:43427] #4605 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-20* random.c (rb_f_srand): fix rdoc: srand(0)'s 0 is a seed.naruse
[ruby-core:35833] fixes #4590 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05* random.c (random_rand): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-25* random.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-20* random.c (random_rand): get rid of overflow.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-04* random.c (rand_init): This checks the value is in 32bit or not,naruse
so use int32_t, not int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-04* random.c (rand_init): remove useless assignment.naruse
* re.c (update_char_offset): remove unused variable. * re.c (read_escaped_byte): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-10* random.c (rb_genrand_ulong_limited): renamed fromnaruse
rb_rand_internal and now this is public API. * include/ruby/ruby.h (rb_genrand_ulong_limited): added. * bignum.c (big_sparse_p): use rb_genrand_ulong_limited. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-26* random.c (rb_random_int32): suppress warning on LP64 platforms.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-25* array.c (rb_ary_{shuffle_bang,sample}): use Random class object.nobu
* random.c (try_get_rnd): use default_rand for Random as same as singleton methods. * random.c (rb_random_real): check the range of result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-25reverted to r29091; r29092 breaks test-allshyouhei
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-25* random.c (rb_random_int32): fixed typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-25* random.c (rb_random_real): check the range of result.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-25* array.c (rb_ary_{shuffle_bang,sample}): use Random class object.nobu
* random.c (try_get_rnd): use default_rand for Random as same as singleton methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-23* array.c (rb_ary_shuffle_bang, rb_ary_sample): add optionalnobu
argument random. [ruby-dev:41923] [EXPERIMENTAL] * random.c (rb_random_{int32,real,bytes}): fallback to normal method invocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-03* random.c (Init_Random): add Random::DEFAULT.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-27* class.c, compile.c, dir.c, file.c, iseq.c, parse.y, random.c:naruse
clean unused-value warnings. * cont.c, process.c, vm_exec.h: clean cast warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-19* random.c (DEFAULT_SEED_LEN): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-13* process.c (rb_fork_err): suppress gcc 4.4 warnings.nobu
* random.c (fill_random_seed): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-26* random.c (random_rand): add the result of random to thenobu
beginning of range, not the opposite. [ruby-dev:41415] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-26* random.c (random_rand): subtraction method of non-numeric cannobu
return Float, and add the result of random to the beginning of range, not the opposite. [ruby-dev:41410] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-13* random.c (make_seed_value): fix leading-zero-guard condition onnobu
bdigit is smaller than 32bit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-12* random.c (rand_init): use the absolute value of seed toakr
make srand(-2**40) portable with 32bit and 64bit. [ruby-core:29292](2) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-07* random.c (rand_init): ignore higher bits if all they are same asnobu
the lower sign bit. [ruby-core:29292](2) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-03fix rdoc. see r26808kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-03* random.c (random_rand): raise ArgumentError on nil, as thenobu
documentation implies. [ruby-core:29075] * random.c (rb_f_rand): mentioned the case of when max is nil. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29* random.c: change include order; ruby.h should be at first.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-15* random.c (default_rand): removed initial buffer.nobu
* random.c (Init_RandomSeed): initialize seed of default random. * random.c (Init_RandomSeed2): turn the seed to Bignum object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-15* random.c (next_state): no initialization here.nobu
* random.c (default_mt): always return initialized MT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-15* random.c (rb_reset_random_seed): set seed in this. [ruby-core:28655]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-03fix rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-05* random.c (fill_random_seed): don't use O_NOFOLLOW becauseakr
/dev/urandom is a symlink in OpenSolaris. * lib/securerandom.rb (SecureRandom.random_bytes: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03* random.c (rb_hash_start): moved from string.c.nobu
* random.c (Init_RandomSeed2): register global address before set. * random.c (Init_RandomSeed): initialize hashseed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25640 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-09* include/ruby/ruby.h (rb_data_type_struct): constified dsize.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-03* random.c (random_rand): fixed rdoc. [ruby-core:25332]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-27* random.c (random_rand): random integer can be a fixnum fornobu
bignum range. [ruby-dev:39173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-26* random.c (random_rand): refined error message.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-26* random.c (random_rand): fixed for edge cases of ranges.nobu
[ruby-dev:39166] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24674 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-26* random.c (random_rand): unified random_int and random_float.nobu
[ruby-dev:39158]. and fixes [ruby-core:24655], [ruby-core:24677], [ruby-core:24679]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-25* random.c (rand_init, random_load): use already defined macro.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-02* random.c (rb_random_int): arguments have to be converted tonobu
integer. [ruby-core:24679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-02* random.c (rand_int): prevent from GC.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-01* random.c (random_float): rejects Infinity and NaN.nobu
[ruby-core:24651] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-30* random.c (init_genrand): ensure invariant of mt->next and mt->left.mame
mt->next should always equal mt->state + N + 1 - mt->left. In fact, 'r = Random.new(0); r == r.dup' has returned false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24325 b2dd03c8-39d4-4d8f-98ff-823fe69b080e