Skip to main content
Module

x/dallmo_util_math/app.ts>random_sections

deno module, a collection of math util under dallmo-util
Latest
function random_sections
import { random_sections } from "https://deno.land/x/dallmo_util_math@v1.2.0/app.ts";

given an input number ( input_num ), and the min and max value of each section, this function divide the input number into random sections, with the requirement that the sum of all sections equal to the input number, and return the result as an array

Parameters

input_num: number
  • the input number
optional
option_obj: RS_Option_Obj
  • the optional obj to adjust min and max

Returns

number[]