R/euclidean.R

#' Greatest common divisor
#' 
#' @param num1 is a number
#' @param num2 is a number
#' @return the Greatest common divisor between two numbers 
#' @references 
#' https://en.wikipedia.org/wiki/Euclidean algorithm
#' @export 







euclidean <- function(num1,num2){
  while(num2!=0){
    t <- num2
    num2 <- num1%%num2
    num1 <- t
  }
  return(num1)
}
marma330/RPG documentation built on May 9, 2019, 5:52 a.m.