Skip to content

ejyu/GCD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

GCD.java

Description

Contains functions that help the user find the greatest common divisor [GCD] of two integers.

This is done using a very specific implementation of the Euclidean Algorithm — which is an extremely efficient way of calculating the GCD without having to use complex computations nor prime factorization. The calculations used in this Java program are ultimately very straight-forward, but contains well-formatted, human-readable code featuring glanceable in-line comments and a flawless programming style.

int Euclidean()

  • Takes two arguments: int a, int b
  • Returns the greatest common divisor of the two integers passed into this method.

int[] ModifiedEuclidean()

  • Takes two arguments: int A, int B
  • Returns an array containing the information needed to calculate the GCD of two integers.

Author

E.J. Yu

About

Two nicely written Java functions for GCD calculation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages