tickStep function Ticks

num tickStep(
  1. num start,
  2. num stop,
  3. num count
)

Returns the difference between adjacent tick values if the same arguments were passed to ticks: a nicely-rounded value that is a power of ten multiplied by 1, 2 or 5.

Note that due to the limited precision of IEEE 754 floating point, the returned value may not be exact decimals; use d4_format to format numbers for human consumption.

Implementation

num tickStep(num start, num stop, num count) {
  final reverse = stop < start,
      inc = reverse
          ? tickIncrement(stop, start, count)
          : tickIncrement(start, stop, count);
  return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);
}