operator - method

PyNum operator -(
  1. PyNum other
)

Subtracts two PyNums, returning a PyNum.

Implementation

PyNum operator -(PyNum other) {
  if (isInt && other.isInt) {
    return PyNum.bigInt(_intValue! - other._intValue!);
  }
  final a = isInt ? _intValue!.toDouble() : _doubleValue!;
  final b = other.isInt ? other._intValue!.toDouble() : other._doubleValue!;
  return PyNum.double(a - b);
}