Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RandomDouble

Random generator for double values.

Example

let value1 = RandomDouble.nextDouble(5, 10);     // Possible result: 7.3
let value2 = RandomDouble.nextDouble(10);        // Possible result: 3.7
let value3 = RandomDouble.updateDouble(10, 3);   // Possible result: 9.2

Hierarchy

  • RandomDouble

Index

Methods

Static nextDouble

  • nextDouble(min: number, max?: number): number
  • Generates a random double value in the range ['minYear', 'maxYear'].

    Parameters

    • min: number

      (optional) minimum range value

    • Default value max: number = null

      max range value

    Returns number

    a random double value.

Static updateDouble

  • updateDouble(value: number, range?: number): number
  • Updates (drifts) a double value within specified range defined

    Parameters

    • value: number

      a double value to drift.

    • Default value range: number = null

      (optional) a range. Default: 10% of the value

    Returns number

Generated using TypeDoc