Shortcuts

Function ripple::math::randint

Function Documentation

auto ripple::math::randint(uint32_t start, uint32_t end) noexcept -> uint32_t

Returns a random 32 bit integer in the range [start, end].

It’s very fast (approx ~1-2ns based on benchmarks, in comparison std::experimental::randint, which is around 16ns), however, the implementation is known to fail some of the random number generation tests.

It also only provides a uniform distribution and can be used when performance is critical and the quality of the generated random number is not hugely important.

Return

A uniformly distributed random number in the given range.

Parameters
  • start: The starting value of the range.

  • end: The end value of the range.

Docs

Access comprehensive developer documentation for Ripple

View Docs

Tutorials

Get tutorials to help with understand all features

View Tutorials

Examples

Find examples to help get started

View Examples