Skip to content

Commit 961c1e5

Browse files
constants expression as value
1 parent cdd2843 commit 961c1e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/variables.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ function Base.:(==)(x::Number,y::Variable)
7979
end
8080

8181
function Base.Expr(x::Variable)
82-
if x.diff == nothing
82+
if x.subtype == :Constant
83+
return x.value
84+
elseif x.diff == nothing
8385
return :($(x.name))
8486
else
8587
return :($(Symbol("$(x.name)_$(x.diff.x.name)")))

0 commit comments

Comments
 (0)