-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ZeroOperator and make D(const) a hard zero
This fixes an odd bug that can occur when a constant can match, like `Differential(2)(2x) == x`, when it should obviously be zero. This fixes Differential(number) == ZeroOperator which acts like a hard zero. You need ZeroOperator instead of 0 because otherwise you codegen to stuff like 0(2x) and get an error that 0 does not have a call, and `zero` the function does not do things like `zero * zero` appropriately, so constructing a simple operator that acts like a true zero is the simplest solution that enforces the safety.
- Loading branch information
1 parent
ee77c8a
commit 0a2643a
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters