Skip to contents

Element-wise tan(pi * x). You can also use tanpi(). Like base R's base::tanpi(), it is exact for a whole argument and NaN at the half integers, where the tangent has its poles.

Usage

nv_tanpi(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

tanpi(nv_array(c(0, 0.25, 0.5, 1)))
#> AnvlArray
#>    0
#>    1
#>  nan
#>    0
#> [ CPUf32{4} ]