-
Notifications
You must be signed in to change notification settings - Fork 29
Added zero, iszero, one, isone to dual #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
5b2401d
700fca9
d51f587
fd87123
e4df99b
e24b59c
0a1bd78
8db4f31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -3,6 +3,7 @@ using Test | |||
using LinearAlgebra | ||||
import DualNumbers: value | ||||
import NaNMath | ||||
import Base: one, isone, zero, iszero | ||||
|
import Base: one, isone, zero, iszero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to explicitly import it to extend it. Try this.
struct ABC end
one(x::ABC) = 1
Will give you the error
ERROR: error in method definition: function Base.one must be explicitly imported to be extended
Stacktrace:
[1] top-level scope at none:0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that, but they are not being extended in the tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not