3 ms·
It's useful to have signed intervals, but most integer type systems return a signed number when subtracting a signed int from a signed int. You kind of have to
by toast0 1y ago
It's useful to have signed intervals, but most integer type systems return a signed number when subtracting a signed int from a signed int.
You kind of have to pick your poison; do you want a) reasonable signed behavior for small differences but inability to represent large differences, b) only able to represent non-negative differences, but with the full width of the type, c) like a, but also convincing your programming system to do a mixed signed subtraction ... like for ptrdiff_t.