From 83a1cf12b70511533cb7f2a45f07f4be97fb8503 Mon Sep 17 00:00:00 2001
From: const-ae <artjom31415@googlemail.com>
Date: Sat, 2 Jan 2021 19:49:23 +0100
Subject: [PATCH] Make sure to return NA_INTEGER when appropriate

This fixes issue #16.
It looks like on x84 machines casting NA_REAL to int returns a
NA_INTEGER. However, on ARM casting NA_REAL to int gives 0. Thus, the
tests for colCounts() and colRanks() failed on ARM.
---
 src/methods.cpp   | 2 +-
 src/sample_rank.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- r-bioc-sparsematrixstats.orig/src/methods.cpp
+++ r-bioc-sparsematrixstats/src/methods.cpp
@@ -553,7 +553,7 @@
           return std::count(values.begin(), values.end(), value);
         }
       }else{
-        return NA_REAL;
+        return NA_INTEGER;
       }
     }
   });
--- r-bioc-sparsematrixstats.orig/src/sample_rank.h
+++ r-bioc-sparsematrixstats/src/sample_rank.h
@@ -1,7 +1,7 @@
 #ifndef sample_rank_h
 #define sample_rank_h
 
-
+#include <type_traits>
 #include <Rcpp.h>
 
 
