Learn R Programming

nimble (version 1.2.1)

pow_int: Power function for integer-valued exponent

Description

pow function with exponent required to be integer

Usage

pow_int(a, b)

Value

a^b

Arguments

a

Base

b

Exponent

Details

This is required in nimble models and nimbleFunctions if derivatives will be tracked but tracked only with respect to a, such that b might be any (positive, 0, or negative) integer. This contrasts with pow(a, b) (equivalent to a^b), which requires b > 0 if derivatives will be tracked, even if they will only be requested with respect to a.