Rand

class Rand(pointer: <Error class: unknown class><<Error class: unknown class>>) : Record

The GRand struct is an opaque data structure. It should only be accessed through the g_rand_* functions.

Skipped during bindings generation

  • parameter seed: Unsupported pointer to primitive type

  • parameter seed: Unsupported pointer to primitive type

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion : RecordCompanion<Rand, <Error class: unknown class>>

Properties

Link copied to clipboard
val glibRandPointer: <Error class: unknown class><<Error class: unknown class>>

Functions

Link copied to clipboard
fun copy(): Rand

Copies a #GRand into a new one with the same exact state as before. This way you can take a snapshot of the random number generator for replaying later.

Link copied to clipboard
fun double(): Double

Returns the next random #gdouble from @rand_ equally distributed over the range [0..1).

Link copied to clipboard
fun doubleRange(begin: Double, end: Double): Double

Returns the next random #gdouble from @rand_ equally distributed over the range [@begin..@end).

Link copied to clipboard
fun free()

Frees the memory allocated for the #GRand.

Link copied to clipboard
fun int(): <Error class: unknown class>

Returns the next random #guint32 from @rand_ equally distributed over the range 0..2^32-1.

Link copied to clipboard
fun intRange(begin: Int, end: Int): Int

Returns the next random #gint32 from @rand_ equally distributed over the range @begin..@end-1.

Link copied to clipboard
fun setSeed(seed: <Error class: unknown class>)

Sets the seed for the random number generator #GRand to @seed.