swift
332b24a7 - [6.1][stdlib] Fix recoverable [U]Int128 division-by-zero (#78045)

Commit
275 days ago
[6.1][stdlib] Fix recoverable [U]Int128 division-by-zero (#78045) * Fix recoverable [U]Int128 division-by-zero This patch fixes the division-by-zero case in the following methods: - `Int128/dividedReportingOverflow(by:)` - `Int128/remainderReportingOverflow(dividingBy:)` - `UInt128/dividedReportingOverflow(by:)` - `UInt128/remainderReportingOverflow(dividingBy:)` * Add preconditions to trapping [U]Int128 division methods. * Make consistent use of `_slowPath(_:)`. Jumping on the `_slowPath(_:)` bandwagon like all other integer types. * Copy existing UInt128 division comments to division operators. * Add a comment about signed remainder overflow semantics as requested. I have paraphrased @stephentyrone's and @xwu's review comments to the best of my ability.
Author
Parents
Loading