lib-utils-ts
Version:
<img src="https://img.shields.io/npm/v/lib-utils-ts"/> <img src="https://img.shields.io/snyk/vulnerabilities/npm/lib-utils-ts"/> <img src="https://img.shields.io/npm/l/lib-utils-ts"/> <img src="https://img.shields.io/github/languages/top/devGnode/lib-util
18 lines (15 loc) • 634 B
text/typescript
import {double, int} from "../Interface";
export class Random {
constructor() {}
/**
@deprecated (end - start + 1) + start
*/
public nextDouble( a: number = 100, b : number = 0 ):double{return Math.random() * ( a - b + 1 ) + b;}
public static nextDouble( a: number = 100, b : number = 0 ):double{return Math.random() * ( a - b + 1 ) + b ;}
/**
@deprecated
*/
public nextInt( a: number = 100, b: number = 0 ):int{return Math.floor(this.nextDouble(a,b));}
public static nextInt( a: number = 100, b: number = 0 ):int{return Math.floor(Random.nextDouble(a,b));}
}
Object.package(this);