R/exponentialMod.R

Defines functions exponentialMod

Documented in exponentialMod

#bit-wise mod 2 add two integers
#' @export
exponentialMod <- function(a,N){
	f <- function(x){
		val <- 1
		for(j in 1:x){
			val <- (val * a) %% N
		}
		val
	}
	f
}

Try the QuantumOps package in your browser

Any scripts or data that you put into this service are public.

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.