-
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 2 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 | ||
|---|---|---|---|---|
|
|
@@ -189,6 +189,17 @@ Base.ceil( ::Type{T}, z::Dual) where {T<:Real} = ceil( T, value(z)) | |||
| Base.trunc(::Type{T}, z::Dual) where {T<:Real} = trunc(T, value(z)) | ||||
| Base.round(::Type{T}, z::Dual) where {T<:Real} = round(T, value(z)) | ||||
|
|
||||
| Base.zero(::Type{Dual{T}}) where {T} = Dual(zero(T), zero(T)) | ||||
| Base.zero(x::Dual{T}) where {T} = zero(T) | ||||
| Base.iszero(z::Dual{T}) where {T} = iszero(value(z)) & iszero(epsilon(z)) | ||||
|
||||
| Base.:(==)(z::Dual, x::Number) = value(z) == x |
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 should these two versions of
zeroreturn different types?