News for hackers. Stuff that matters.
Re:Ask HN: What is your favorite equation? by jbpetersen on Saturday December 24, 2016 @02:44AM (#13249018)

  // since typing it out like this is preferable to reteaching myself LaTeX right now
  
  let favoriteEquation = arr => {
    let total = 0;
    for(let x of arr)
      total += Math.abs(x);
    let normalizedArr = [];
    for(let x of arr)
      normalizedArr.push(Math.abs(x/total));
    return normalizedArr;
  };

There are no comments on this comment yet.