apple / apple/swift-numerics

Add Least Common Multiple

Open
#327 5 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

This is an enhancement request to add least common multiple to the package. A major issue with least common multiple is that it is not uncommon for it to overflow when used with fixed width integers. This PR offers two functions, one that traps and one that throws should the result not be representable in its result type.

The code changes are in this PR: https://github.com/jasonbobier/swift-numerics/pull/1

It currently is waiting on the resolution of https://github.com/apple/swift-numerics/pull/320 and then the base will be switched to apple/numerics.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing jasonbobier/swift-numerics#1 and the pending dependency apple/swift-numerics#320, since the proposed implementation is already there and is waiting on that resolution. Done means the least-common-multiple API is integrated after the base changes, with both overflow behaviors covered by the package's tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.