sinc function Null safety

double sinc(
  1. double x
)

compute nomilized sinc function of x

Implementation

double sinc(double x) {
  var y;
  if (x == 0) {
    y = 1.0e-20;
  } else {
    y = x;
  }

  y = pi * y;

  return sin(y) / y;
}