nextn
returns the smallest integer,
greater than or equal to n
, which can be obtained
as a product of powers of the values contained in factors
.
nextn()
is intended to be used to find a suitable length
to zero-pad the argument of fft
so that the transform is computed quickly.
The default value for factors
ensures this.
nextn(n, factors = c(2,3,5))
a vector of integer numbers (of type "integer"
or "double"
).
a vector of positive integer factors (at least
a vector of the same length
as n
, of type
"integer"
when the values are small enough (determined before
computing them) and "double"
otherwise.
# NOT RUN {
nextn(1001) # 1024
table(nextn(599:630))
n <- 1:100 ; plot(n, nextn(n) - n, type = "o", lwd=2, cex=1/2)
# }
Run the code above in your browser using DataLab