Comments (6)
How are you using nan
in your code?
from dualnumbers.jl.
I'm not sure that this will help you,
but I use it when creating a lightweight version of one of my composite types.
(to save on network transmission, in my parallel code).
I want to set one of the fields to NaN so that if it is ever accesses (which on the lightweight version it shouldn't be), it becomes immediately apparent.
I further have a version of the lightweight type that support converting,
as part of me using it with ForwardDiff.jl
Yes there are other ways to do it, eg Nullable, which may be better.
But because I was using NaN as a quick hack,
I came across the aforementioned unexpected behavior.
EDIT: I've removed the code I posted cos that code is full of bugs and typos (clearly I need to sleep). Point being it doesn't seem logical that nan(Dual{Float32}) should produce a Float32. If it has to for implementation reasons, then that should be documented (if it isn't already)
from dualnumbers.jl.
It was added in commit 336b003 , if that helps you remember why you made it that way.
I'm sure you had a good reason at the time.
from dualnumbers.jl.
Since we overload the comparison operators, I think it's safe to make this change. Will need some testing though.
from dualnumbers.jl.
Now, inf(T)
and nan(T)
are deprecated in favor of convert(T, Inf)
and convert(T, NaN)
, so I think these should simply be removed (after ample deprecation).
from dualnumbers.jl.
Resolved by #27
from dualnumbers.jl.
Related Issues (20)
- 0.4: @compat value.(v) for v::Vector{Dual{Float64}} returns Vector{Any}
- Replace this package with ForwardDiff's `Dual`? HOT 13
- Tag a new version
- isapprox throws an error
- max when values agree?
- erf function broken in julia Nightly HOT 1
- / HOT 1
- / HOT 1
- Support for fft of DualComplex Numbers
- @show imε output
- Package compatibility caps HOT 1
- Odd behavior: `sparse(M::Array{Dual{Float64}})` zeroes dual values HOT 2
- isless broken for mixed types
- TagBot trigger issue HOT 13
- Consider renaming realpart to value or primalpart or similar
- Should we export ϵ ≡ ε?
- bitmix not defined
- Complex Differentiation HOT 5
- div() and rem()
- Consider replacing SpecialFunctions.jl by pure Julia alternatives HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dualnumbers.jl.