dual_constant: Create a dual constant (derivative seed = 0)

View source: R/dual-class.R

dual_constantR Documentation

Create a dual constant (derivative seed = 0)

Description

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

Usage

dual_constant(x)

Arguments

x

A numeric value.

Value

A dual with value = x and deriv = 0.

Examples

k <- dual_constant(5)
deriv(k)

nabla documentation built on Feb. 11, 2026, 1:06 a.m.