Ruby: include/ruby/internal/intern/random.h Source File

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

random.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_RANDOM_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_RANDOM_H
27#include "ruby/internal/dllexport.h"
28#include "ruby/internal/value.h"
29
30 RBIMPL_SYMBOL_EXPORT_BEGIN()
31
32/* random.c */
33
34
41unsigned int rb_genrand_int32(void);
42
49double rb_genrand_real(void);
50
56void rb_reset_random_seed(void);
57
73 VALUE rb_random_bytes(VALUE rnd, long n);
74
81unsigned int rb_random_int32(VALUE rnd);
82
89double rb_random_real(VALUE rnd);
90
103unsigned long rb_random_ulong_limited(VALUE rnd, unsigned long limit);
104
112unsigned long rb_genrand_ulong_limited(unsigned long i);
113
114 RBIMPL_SYMBOL_EXPORT_END()
115
116#endif /* RBIMPL_INTERN_RANDOM_H */
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
rb_genrand_ulong_limited
unsigned long rb_genrand_ulong_limited(unsigned long i)
Generates a random number whose upper limit is i.
Definition random.c:1065
rb_random_real
double rb_random_real(VALUE rnd)
Identical to rb_genrand_real(), except it generates using the passed RNG.
Definition random.c:1137
rb_random_int32
unsigned int rb_random_int32(VALUE rnd)
Identical to rb_genrand_int32(), except it generates using the passed RNG.
Definition random.c:1094
rb_reset_random_seed
void rb_reset_random_seed(void)
Resets the RNG behind rb_genrand_int32()/rb_genrand_real().
Definition random.c:1776
rb_random_bytes
VALUE rb_random_bytes(VALUE rnd, long n)
Generates a String of random bytes.
Definition random.c:1295
rb_genrand_real
double rb_genrand_real(void)
Generates a double random number.
Definition random.c:199
rb_random_ulong_limited
unsigned long rb_random_ulong_limited(VALUE rnd, unsigned long limit)
Identical to rb_genrand_ulong_limited(), except it generates using the passed RNG.
Definition random.c:1197
rb_genrand_int32
unsigned int rb_genrand_int32(void)
Generates a 32 bit random number.
Definition random.c:192
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40