Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finagle gcd and lcm to satisfy a multiplicative identity #28

Merged
merged 1 commit into from
Apr 21, 2024

Conversation

frostburn
Copy link
Member

Replicate something similar for radical/radicand analogues. Extend gcd, lcm and mmod to bigints.
Fix zero fraction normalization.

ref #27

@frostburn frostburn linked an issue Apr 20, 2024 that may be closed by this pull request
src/fraction.ts Outdated
export function lcm(a: bigint, b: bigint): bigint;
export function lcm(a: number | bigint, b: typeof a): typeof a {
// @ts-ignore
return a ? (a / gcd(a, b)) * b : typeof a === 'number' ? 0 : 0n;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that 0 just a?

Replicate something similar for radical/radicand analogues.
Extend gcd, lcm and mmod to bigints.
Fix zero fraction normalization.

ref #27
@frostburn frostburn force-pushed the negative-weirdness branch from 1f64924 to 6bf980e Compare April 20, 2024 16:07
@frostburn frostburn merged commit 2ef952d into main Apr 21, 2024
1 check passed
@frostburn frostburn deleted the negative-weirdness branch April 21, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Push negative fraction weirdness into LCM
1 participant