The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Version: 1.3
Date: 2022-08-31
Title: Binary Exponentiation
Depends: R (≥ 3.0.0)
Description: Fast exponentiation when the exponent is an integer.
License: GPL (≥ 3)
NeedsCompilation: yes
Packaged: 2022-08-31 16:34:14 UTC; jon
Author: Jonathan Debove [aut, cre]
Maintainer: Jonathan Debove <jondebove@gmail.com>
Repository: CRAN
Date/Publication: 2022-08-31 18:50:02 UTC

Binary Exponentiation

Description

Fast exponentiation when the exponent is an integer.

Usage

pow.int(x, n)
x %^% n

Arguments

x

a numeric vector giving the base.

n

an integer vector giving the exponent.

Value

A numeric vector.

Note

This function is just a wrapper around R_pow_di in the Rmath library.

Author(s)

Jonathan Debove

Examples

3 %^% 12L

# Basic tests
x <- runif(10)
n <- as.integer(runif(length(x), 0, 100))
stopifnot(all.equal(pow.int(x, n),  x ^ n))
stopifnot(all.equal(pow.int(x[1], n),  x[1] ^ n))
stopifnot(all.equal(pow.int(x, n[1]),  x ^ n[1]))
stopifnot(all.equal(pow.int(x[1:2], n),  x[1:2] ^ n))
stopifnot(all.equal(pow.int(x, n[1:2]),  x ^ n[1:2]))

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.