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

Ruby 3.3.4p94 (2024-07-09 revision be1089c8ec5ba40e09b1553e36b3174bf4014d9d)

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:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
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:1071
rb_random_real
double rb_random_real(VALUE rnd)
Identical to rb_genrand_real(), except it generates using the passed RNG.
Definition random.c:1143
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:1100
rb_reset_random_seed
void rb_reset_random_seed(void)
Resets the RNG behind rb_genrand_int32()/rb_genrand_real().
Definition random.c:1782
rb_random_bytes
VALUE rb_random_bytes(VALUE rnd, long n)
Generates a String of random bytes.
Definition random.c:1301
rb_genrand_real
double rb_genrand_real(void)
Generates a double random number.
Definition random.c:205
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:1203
rb_genrand_int32
unsigned int rb_genrand_int32(void)
Generates a 32 bit random number.
Definition random.c:198
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40