-
Notifications
You must be signed in to change notification settings - Fork 129
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
Added nan
to the DaCe math
namespace
#1437
Conversation
Before this was generating an error, because there was no object `nan` inside the `dace::math` namespace. This commit adds a `nan` object to the namespace, the implementation is based on `typeless_pi`.
There are two bugs. - On the CI `std::enable_if_t` was not there, so I changed it to the `typename std::enable_if`. - Also added operations regarding `typeless_nan` with itself (`typeless_pi` is missing them).
The same is also not used for `pi`.
112d070
to
8a9cb2c
Compare
dace/runtime/include/dace/nan.h
Outdated
operator int() const = delete; | ||
operator float() const | ||
{ | ||
return std::nanf(""); |
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.
std::nan*
use strto*
, which will be slow. Please use numeric_limits' NaN: https://en.cppreference.com/w/cpp/types/numeric_limits/quiet_NaN
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.
Thanks for reminding me about that thing.
Before this was generating an error, because there was no object
nan
inside thedace::math
namespace. This commit adds anan
object to the namespace, the implementation is based ontypeless_pi
.