-
Notifications
You must be signed in to change notification settings - Fork 11
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
Centralize definitions of NaN and -5 #24
Comments
@FernandaPsihas @PetrilloAtWork can you coordinate this? If it can be done by 2021C, great -- if not, let's move it to general Infrastructure/Utilities. |
kSignalingNaN is being introduced in #44 |
|
There was the question whether $ float const f = std::numeric_limits<float>::signaling_NaN()
(const float) nanf
$ double d = std::numeric_limits<float>::signaling_NaN()
(double) nan
$ std::isnan(d)
(bool) true So in short: a Just mentioning here that we could in principle have a specific NaN for uninitialised variables. It would behave as any other NaN value, but on careful inspection it may be identified as the "uninitialised variable" NaN. |
It was mentioned in a couple of reviews that we should have some standard place where we defined the magic constants
-5
andnumeric_limits<float>::signaling_NaN()
.We may also need to review the use of these values. The original intention in NOvA, which I think is not documented anywhere in SBN, is that a NaN value surviving to the final CAF indicates a bug in CAFMaker, where it has failed to initialize a field. Whereas a field that is somehow unfillable gets -5. Of course that magic number doesn't work for all variables, and we have some -999s etc as well.
The text was updated successfully, but these errors were encountered: