4 ms·
Without signed integers, the scaling function will turn arguments like (-4, -3) to garbage. In order to disallow negatives, you need signed arguments, or else
by kazinator 11y ago
Without signed integers, the scaling function will turn arguments like (-4, -3) to garbage.
In order to disallow negatives, you need signed arguments, or else to reduce the range. (Say the numerator and denominator cannot exceed 255 or whatever). Otherwise the function has no way of knowing whether argument values (UINT_MAX-3, UINT_MAX-2) are a mistaken aliasing of -4, -3 or deliberately chosen positive values.
- ridiculous_fish 11y agoGarbage in, garbage out, as they say. For all we know the ScaleWindowExtEx did have a domain check that disallowed negatives, but it put it after the division.
- SamReidHughes 11y agoIt permits negatives! SetWindowExtEx permits negatives!