sign<T extends num> function

T sign<T extends num>(
  1. T a,
  2. num b
)

Implementation

T sign<T extends num>(final T a, final num b) {
  return a.abs() * (b.isNegative ? -1 : 1) as T;
}