1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-07 07:55:04 -05:00

Use null for unknown hashrate in API.

This commit is contained in:
XMRig
2019-04-25 02:22:53 +07:00
parent 304d7bd09a
commit 378bc504fc

View File

@@ -40,13 +40,15 @@
#include "workers/Workers.h"
static inline double normalize(double d)
static inline rapidjson::Value normalize(double d)
{
using namespace rapidjson;
if (!isnormal(d)) {
return 0.0;
return Value(kNullType);
}
return floor(d * 100.0) / 100.0;
return Value(floor(d * 100.0) / 100.0);
}