# RandomUtil

`RandomUtil` class is used to generate pseudo-random numbers in java. An instance of this class is thread-safe. The instance of this class is however cryptographically insecure. This class provides various method calls to generate different random data types such as float, double, int.

```javascript
/**
 * Write your code here
 * For example a random condition that returns true or false and output them to a different output port
 */
var random = RandomUtil.create(); // create a Random instance
return random.nextBoolean(); // return random boolean (true/false)
return random.nextInt(); // return random Integer
return random.nextDouble(); // return random Double
return random.nextLong();
return random.nextFloat();
return random.nextGaussian();
```

* `nextGaussian();`&#x20;

Returns the next pseudorandom Gaussian distributed double number with mean 0.0 and standard deviation 1.0.

* `nextInt();`

Returns the next Integer number.

* `nextInt(bound: number): number;`

Returns the next Integer number, within certain bound

```typescript
var random = RandomUtil.create(); // create a Random instance
return random.nextInt(100);
```

* `nextDouble();`

Returns the next double number.

* `nextBoolean();`

Returns the next Boolean value.

* `nextLong();`

Returns the next Long number


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.b2winsuite.com/5.6/scripting/utilities/randomutil.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
