Skip to content

Commit d83f479

Browse files
joyeecheungRenegade334
authored andcommitted
Fix compilation for older version of libstdc++
On older versions of libstdc++, cmath didn't expose std::powl. Use std::pow instead. Co-Authored-By: René <[email protected]> Refs: https://gcc.gnu.org/pipermail/libstdc++/2023-February/055493.html Refs: nodejs/node#61898 Change-Id: I4587e14525cae68a05eda03c36b0af40759d9b64 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7666244 Commit-Queue: Joyee Cheung <[email protected]> Reviewed-by: Jakob Linke <[email protected]> Cr-Commit-Position: refs/heads/main@{#105884}
1 parent 56e64fb commit d83f479

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/objects/js-duration-format.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ void OutputFractional(const char* type, int64_t integer, int32_t powerOfTen,
807807
// Pass in the value as int64_t and ask ICU to scale down.
808808
nfOpts = nfOpts.scale(icu::number::Scale::powerOfTen(-powerOfTen));
809809

810-
int64_t factor = static_cast<int64_t>(std::powl(10, powerOfTen));
810+
int64_t factor = static_cast<int64_t>(std::pow(10.0L, powerOfTen));
811811
int64_t bound = std::numeric_limits<int64_t>::max() / factor - 1;
812812
UErrorCode status = U_ZERO_ERROR;
813813
// Use faster ICU API formatInt if the value fit the precision int64_t,

0 commit comments

Comments
 (0)