idiv method
Implementation
@override
XPathInteger idiv(XPathNumeric other) => switch (other) {
final XPathInteger i =>
i.value == BigInt.zero
? throw XPathEvaluationException(
XPathErrorCode.FOAR0001,
'Division by zero',
)
: XPathInteger(value ~/ i.value),
final XPathDecimal d => toDecimal().idiv(d),
final XPathDouble d =>
d.value == 0
? throw XPathEvaluationException(
XPathErrorCode.FOAR0001,
'Division by zero in idiv',
)
: d.value.isNaN
? throw XPathEvaluationException(
XPathErrorCode.FOAR0002,
'NaN in idiv',
)
: d.value.isInfinite
? XPathInteger(BigInt.zero)
: XPathDouble(toDouble()).idiv(d),
};