C3E: Complex Compute Core Engine v1.0
An engine for handling complex computational tasks
Loading...
Searching...
No Matches
random.h File Reference

Random number generation utilities for the C3E library. More...

#include <c3e/commons.h>
Include dependency graph for random.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

c3e_number c3e_random ()
 Generates a random number.
 
c3e_number c3e_random_pseudo ()
 Generates a pseudorandom number.
 
c3e_number c3e_random_bound (c3e_number min, c3e_number max)
 Generates a random number within a specified range.
 

Detailed Description

Author
Nathanne Isip

This file provides functions for generating random numbers within the C3E library. It includes utilities for generating random numbers with varying characteristics, including pseudorandom values and numbers within a specified range.

Function Documentation

◆ c3e_random()

c3e_number c3e_random ( )

This function produces a random floating-point number from /dev/urandom. The number generated is uniformly distributed within this range.

Returns
A random number in the range [0.0, 1.0).

◆ c3e_random_bound()

c3e_number c3e_random_bound ( c3e_number  min,
c3e_number  max 
)

This function generates a random floating-point number between min and max. The generated number is uniformly distributed within the specified range.

Parameters
minThe lower bound of the range (inclusive).
maxThe upper bound of the range (inclusive).
Returns
A random number within the range [min, max].

◆ c3e_random_pseudo()

c3e_number c3e_random_pseudo ( )

This function produces a pseudorandom floating-point number between 0.0 and 1.0. Unlike c3e_random(), this function may use a different algorithm or seed for generating pseudorandom numbers, providing a potentially different distribution or pattern of randomness.

Returns
A pseudorandom number in the range [0.0, 1.0).