Skip to content

Commit 26fc511

Browse files
committed
Add diff rule for one
1 parent 5220a41 commit 26fc511

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/differentials.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ end
113113

114114
derivative(::typeof(+), args::NTuple{N,Any}, ::Val) where {N} = 1
115115
derivative(::typeof(*), args::NTuple{N,Any}, ::Val{i}) where {N,i} = Operation(*, deleteat!(collect(args), i))
116+
derivative(::typeof(one), args::Tuple{<:Any}, ::Val) = 0
116117

117118
function count_order(x)
118119
@assert !(x isa Symbol) "The variable $x must have an order of differentiation that is greater or equal to 1!"

0 commit comments

Comments
 (0)