MCPcopy Create free account
hub / github.com/catboost/catboost / Round

Function Round

util/stream/format.cpp:8–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7namespace NFormatPrivate {
8 static inline i64 Round(double value) {
9 double res1 = floor(value);
10 double res2 = ceil(value);
11 return (value - res1 < res2 - value) ? (i64)res1 : (i64)res2;
12 }
13
14 static inline IOutputStream& PrintDoubleShortly(IOutputStream& os, const double& d) {
15 // General case: request 3 significant digits

Callers 1

Calls 2

floorFunction · 0.50
ceilFunction · 0.50

Tested by

no test coverage detected