<commit_before>export function rand ({ min = 0, max = 1 }) {
  return Math.random() * (max - min + 1) + min
}

export function pick (array = []) {
  return array[Math.floor(this.rand({ max: array.length - 1 }))]
}

export function spread (value, spread) {
  spread = spread / 2
  return rand({ min: value - spread, max: value + spread})
}

export function chance (luck) {
  return Math.random() * luck < luck
}<commit_msg>Fixed random<commit_after>export function frand ({ min = 0, max = 1 } = {}) {
  min *= 100
  max *= 100
  return Math.floor(Math.random() * (max - min) + min) / 100
}

export function irand ({ min = 0, max = 1 } = {}) {
  return Math.floor(frand({ min, max }))
}

export function pick (array = []) {
  return array[irand({ max: array.length })]
}

export function spread (value, spread) {
  spread = spread / 2
  return frand({ min: value - spread, max: value + spread})
}

export function chance (luck) {
  return frand() < luck
}
{'fraction_non_alphanumeric': 0.1626442812172088, 'fraction_numerical': 0.01993704092339979, 'mean_word_length': 3.376146788990826, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1958820', 'n_tokens_mistral': 336, 'n_tokens_neox': 317, 'n_words': 106}