Skip to content

Commit

Permalink
Fix boundary case in array differentiation
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Dec 18, 2024
1 parent d399f40 commit c2f1cf1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/dsl-differentiate-expr.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ derivative <- list(
`[` = function(expr, name) {
target <- as.character(expr[[2]])
if (target != name) {
return(name)
return(0)
}
index <- as.list(expr[-(1:2)])

Expand Down

0 comments on commit c2f1cf1

Please sign in to comment.