title: Check if value equals 0 regardless of decimal values?
body: <p>I'm balancing the sigma of a Gaussian kernel. I desire to break the while loop once the first index of the array is equal to <code>0.(any decimal value)</code>.</p>
  
  <p>I found that simply trying to match <code>0</code> won't match if the value also contains any decimals like <code>0.000013301</code>.</p>
  
  <pre><code>var gaussianKernel1d = (function() {
      var sqr2pi = Math.sqrt(2 * Math.PI);
  
      return function gaussianKernel1d(size, sigma) {
          'use strict';
  
          // ensure size is even and prepare variables
          var width = (size / 2) | 0,
              kernel = new Array(width * 2 + 1),
              norm = 1.0 / (sqr2pi * sigma),
              coefficient = 2 * sigma * sigma,
              total = 0,
              x;
  
          // set values and increment total
          for (x = -width; x &lt;= width; x++) {
              total += kernel[width + x] = norm * Math.exp((-x * x) / coefficient);
          }
  
          // divide by total to make sure the sum of all the values is equal to 1
          for (x = 0; x &lt; kernel.length; x++) {
              kernel[x] /= total;
          }
  
          return kernel;
      };
  })();
  
  let i = 0.01;
  let kernelArray = gaussianKernel1d(512, i);
  while (kernelArray[0] === 0) {
      i = i + 0.01;
      kernelArray = gaussianKernel1d(512, i);
  </code></pre>
  
  <p>Same is also true when using <code>Array[0] !== 0.0)</code></p>
  
  <p>How can I match any values in the dataset that equal 0 regardless of the decimal values? And without converting the array to integers.</p>