Wraps a numeric value as a dual with zero derivative, representing a constant with respect to the differentiation variable.

dual_constant(x)

Arguments

x

A numeric value.

Value

A dual with value = x and deriv = 0.

Examples

k <- dual_constant(5)
deriv(k)  # 0
#> [1] 0