| 87 | } |
| 88 | |
| 89 | std::string ExponentToPrefix(int64_t exponent, bool iec) { |
| 90 | if (exponent == 0) return ""; |
| 91 | |
| 92 | const int64_t index = (exponent > 0 ? exponent - 1 : -exponent - 1); |
| 93 | if (index >= kUnitsSize) return ""; |
| 94 | |
| 95 | const char* array = |
| 96 | (exponent > 0 ? (iec ? kBigIECUnits : kBigSIUnits) : kSmallSIUnits); |
| 97 | if (iec) |
| 98 | return array[index] + std::string("i"); |
| 99 | else |
| 100 | return std::string(1, array[index]); |
| 101 | } |
| 102 | |
| 103 | std::string ToBinaryStringFullySpecified(double value, double threshold, |
| 104 | int precision, double one_k = 1024.0) { |
no outgoing calls
no test coverage detected