MCPcopy Create free account
hub / github.com/chen3feng/toft / round

Function round

base/benchmark.cpp:84–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84static int round(int n) {
85 int base = 1;
86
87 while (base * 10 < n) {
88 base *= 10;
89 }
90 if (n < 2 * base) {
91 return 2 * base;
92 }
93 if (n < 5 * base) {
94 return 5 * base;
95 }
96 return 10 * base;
97}
98
99void RunBench(Benchmark* b, int nthread, int siz) {
100 int n, last;

Callers 1

RunBenchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected