95 double ax = std::fabs(value);
99 return {.value = 0.0, .prefix =
"", .ratio = 1.0};
103 const auto &largest = si.back();
104 if (ax >= largest.second) {
106 .value = value / largest.second, .prefix = largest.first, .ratio = largest.second};
109 for (
int i =
static_cast<int>(si.size()) - 2; i >= 0; --i) {
110 if (ax >= si[i].second) {
112 .value = value / si[i].second, .prefix = si[i].first, .ratio = si[i].second};
117 const auto &smallest = si.front();
119 .value = value / smallest.second, .prefix = smallest.first, .ratio = smallest.second};