Fixed to say `if (input[i] == NA_INTEGER) return NA_REAL;` which returns the correct (double-type) NA if an (int-type) NA is seen.