Skip to contents

Element-wise cos(pi * x). You can also use cospi().

Usage

nv_cospi(x)

Arguments

x

(arrayish)
One input. Can be any numeric data type: a float keeps its own, and an integer one is converted to the default float data type (see default_dtypes()). An R value materializes at its default data type and is converted in the same way.

Value

(arrayish)
Has the input's shape, and its data type – or the default float data type (see default_dtypes()) where the input was an integer one.

Examples

cospi(nv_array(c(0, 0.5, 1, 1.5)))
#> AnvlArray
#>   1
#>   0
#>  -1
#>   0
#> [ CPUf32{4} ]