Compact GCD

by Ricardo “Rudxain” Fernández Serrata

Version 10 (November 30, 2022)

Download (43 downloads)

Calculates the Greatest/Highest Common Divisor/Factor using the optimized Euclidean Algorithm (the modulo-based, no subtraction), with a hack similar to destructuring assignment, to avoid temporary var.

This is guaranteed to return correct results regardless of input value or type (even if you bypass the Input-Dialogs), and it's guaranteed to halt (no infinite loop).

Some combinations of rational numbers will yield weird results due to rounding errors.

The subroutine is intended to be embedded in flows.

LICENSE: https://unlicense.org

4.0 average rating from 1 reviews

5 stars
0
4 stars
1
3 stars
0
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.