docs » hs.math

Various helpful mathematical functions

API Overview

API Documentation

Functions

randomFloat
Signature hs.math.randomFloat() -> number
Type Function
Description

Returns a random floating point number between 0 and 1

Parameters:

  • None

Returns:

  • A random number between 0 and 1
randomFromRange
Signature hs.math.randomFromRange(start, end) -> integer
Type Function
Description

Returns a random integer between the start and end paramters

Parameters:

  • start - A number to start the range, must be greater than or equal to zero
  • end - A number to end the range, must be greater than zero and greater than start

Returns:

  • A randomly chosen integer between start and end