MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / normalize

Method normalize

inst/include/Rcpp/hash/IndexHash.h:206–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205 template <>
206 inline double IndexHash<REALSXP>::normalize(double val) const {
207 /* double is a bit tricky - we have to normalize 0.0, NA and NaN */
208 if (val == 0.0) val = 0.0;
209 if (internal::Rcpp_IsNA(val)) val = NA_REAL;
210 else if (internal::Rcpp_IsNaN(val)) val = R_NaN;
211 return val;
212 }
213
214 template <>
215 inline uint32_t IndexHash<INTSXP>::get_addr(int value) const {

Callers

nothing calls this directly

Calls 2

Rcpp_IsNAFunction · 0.50
Rcpp_IsNaNFunction · 0.50

Tested by

no test coverage detected