signWithZeroTolerance method

int signWithZeroTolerance([
  1. double zeroTolerance = 0.0000000000001
])

Implementation

int signWithZeroTolerance([double zeroTolerance = 0.0000000000001]) {
  if (this > 0) {
    return this < zeroTolerance ? 0 : 1;
  } else {
    return this > -zeroTolerance ? 0 : -1;
  }
}