apple / apple/swift-numerics

Enhanced GCD that doesn't trap

Open
#311 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.9k
Forks
181
Avg merge
2d 5h
Merged PRs (30d)
6

Description

By returning T.Magnitude instead of T, the gcd call never traps. This also allows the end user of the call to decide how to handle the result.

PR: https://github.com/apple/swift-numerics/pull/310

(Also note that this is in preparation for lcm, which will be a separate PR.)

Contributor guide

Open the contributing guide

Research direction

Review PR #310 and the existing gcd implementation first, then check how its current return type and trapping behavior are covered. Done means gcd returns T.Magnitude without trapping and leaves result handling to the caller; lcm remains separate.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.