Excuse my ignorance, but why are releases not being made regularly if regular improvements are coming in, regardless of what they're for? This goes for any Apple-owned package. I.E.:
main ← stephentyrone:floating-point-rounding
opened 04:01PM - 15 Aug 24 UTC
IntegerUtilities has RoundingRule that is a superset of FloatingPointRoundingRul… e; many of these are also useful when working with floating-point. This change provides a `rounding(_:)` function similar to the standard libraries `rounded(_:)` that makes all of them available. It has a different name instead of being a shadow because otherwise existing use sites like `rounded(.down)` would become ambiguous.
main ← stephentyrone:round-out-rounding
opened 08:18PM - 19 Jul 24 UTC
These were omitted in the first pass over integer rounding rules, but are genera… lly useful and make good sense to have available. In particular, toNearestOrUp is the natural mode for a lot of fixed-point arithmetic, and frequently has HW support on SIMD units, so it makes good sense to have a name for that. Once you add that, having nearestOrDown also makes sense, and then nearestOrZero should exist by analogy to nearestOrAway. Also beefed up testing and refactored the division rounding code somewhat.
Also renamed `toNearestOrAwayFromZero` to `toNearestOrAway` for symmetry. The original name was never released, but we'll keep it around in deprecated form anyway.
main ← stephentyrone:double-width-improvements
opened 01:18PM - 10 Jul 24 UTC
These are used only in TestSupport, but it's still nice to get them right. Signe… d types had a long-standing bug in how overflow was computed for multiplication, and masking shifts would do the wrong thing when the bitwdith was not a power of two and the shift count was negative. I also added implementations of `&*`, `&+`, and `&-`.
I can go on…
3 Likes