Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Unified Diff: base/float_util.h

Issue 14600025: Replace AudioSilenceDetector with an AudioPowerMonitor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use CancelableCallback instead of extra-task for close reply. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/cancelable_callback.h ('k') | base/time/time.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/float_util.h
diff --git a/base/float_util.h b/base/float_util.h
index 458e85965b29657bf4044837c4cd1c88263d5d98..90273106cd65193dbef7edeba2825e1c040adabb 100644
--- a/base/float_util.h
+++ b/base/float_util.h
@@ -13,7 +13,8 @@
namespace base {
-inline bool IsFinite(const double& number) {
+template <typename Float>
+inline bool IsFinite(const Float& number) {
#if defined(OS_POSIX)
return std::isfinite(number) != 0;
#elif defined(OS_WIN)
@@ -21,6 +22,15 @@ inline bool IsFinite(const double& number) {
#endif
}
+template <typename Float>
+inline bool IsNaN(const Float& number) {
+#if defined(OS_POSIX)
+ return std::isnan(number) != 0;
+#elif defined(OS_WIN)
+ return _isnan(number) != 0;
+#endif
+}
+
} // namespace base
#endif // BASE_FLOAT_UTIL_H_
« no previous file with comments | « base/cancelable_callback.h ('k') | base/time/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698