Skip to content
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

Merged
merged 9 commits into from
Dec 12, 2023

Conversation

philip-paul-mueller
Copy link
Collaborator

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.

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).
operator int() const = delete;
operator float() const
{
return std::nanf("");
Copy link
Collaborator

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

Copy link
Collaborator Author

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.

@philip-paul-mueller philip-paul-mueller removed the request for review from BenWeber42 December 11, 2023 11:32
@tbennun tbennun merged commit ae378e1 into spcl:master Dec 12, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants