summaryrefslogtreecommitdiff
path: root/absl/base/internal
diff options
context:
space:
mode:
authorGravatar Abseil Team <absl-team@google.com>2021-06-24 09:53:14 -0700
committerGravatar rogeeff <rogeeff@google.com>2021-06-27 12:10:27 -0400
commit9a7e447c511dae7276ab65fde4d04f6ed52b39c9 (patch)
tree4f744fc17c0ee56f9af1c7d1ff8f5c3d1b9e3666 /absl/base/internal
parenta2419e63b8ae3b924152822f3c9f9da67ff6e215 (diff)
Export of internal Abseil changes
-- 373171b46238585c818cec37af26959f5412f813 by Abseil Team <absl-team@google.com>: Build with -Wl,-no-undefined. PiperOrigin-RevId: 381276748 -- da32624792d2948fe83d0ce58794d505799ab5d0 by Benjamin Barenblat <bbaren@google.com>: s/round/rint/ in exponential_biased `rint` differs from `round` in that it uses the current FPU rounding mode. It’s thus potentially faster, since it doesn’t have to save and restore FPU state. It also is more reflective of developer intent – most developers expect all FPU operations to use the current rounding mode, and having exponential_biased follow that rule seems ideal. PiperOrigin-RevId: 381268264 -- 8f860253a4283d2cc8230fe98d7cdf7bcb3e05f1 by Abseil Team <absl-team@google.com>: Internal change. PiperOrigin-RevId: 381264180 GitOrigin-RevId: 373171b46238585c818cec37af26959f5412f813 Change-Id: Iefe60b15c80318a7707e0c32159ac004bfa26d72
Diffstat (limited to 'absl/base/internal')
-rw-r--r--absl/base/internal/exponential_biased.cc2
-rw-r--r--absl/base/internal/exponential_biased.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/absl/base/internal/exponential_biased.cc b/absl/base/internal/exponential_biased.cc
index 1b30c061..05aeea56 100644
--- a/absl/base/internal/exponential_biased.cc
+++ b/absl/base/internal/exponential_biased.cc
@@ -64,7 +64,7 @@ int64_t ExponentialBiased::GetSkipCount(int64_t mean) {
// Assume huge values are bias neutral, retain bias for next call.
return std::numeric_limits<int64_t>::max() / 2;
}
- double value = std::round(interval);
+ double value = std::rint(interval);
bias_ = interval - value;
return value;
}
diff --git a/absl/base/internal/exponential_biased.h b/absl/base/internal/exponential_biased.h
index 94f79a33..a81f10e2 100644
--- a/absl/base/internal/exponential_biased.h
+++ b/absl/base/internal/exponential_biased.h
@@ -66,7 +66,7 @@ namespace base_internal {
// Adjusting with rounding bias is relatively trivial:
//
// double value = bias_ + exponential_distribution(mean)();
-// double rounded_value = std::round(value);
+// double rounded_value = std::rint(value);
// bias_ = value - rounded_value;
// return rounded_value;
//