guardedDivInto

fnsize_t guardedDivInto(T, R, string op)(const(T)[] a, const(T)[] b, R[] outValues, ulong[] outGuards) if (isIntegral!T && (op == "/" || op == "%"))

Computes the guarded integer division or modulo into outValues, writing a zero at guarded-out slots (the caller nulls those slots from the guard words). Every slot is inspected before dividing, so null slots whose bits happen to be zero or T.min % -1 never trap (D14). Integer `/` is true division: the result element type R is double.

Parameters

Tthe common element type (integral)
Rthe result element type (double for `"/"`, T for `"%"`)
op`"/"` or `"%"`
athe left operand
bthe right operand (same length as a)
outValuesthe destination, a.length elements
outGuardsthe guard bits, at least packedWords(a.length) words; a set bit means the slot is computed

Returns

the number of guard words written.