Skip to content

Commit ba41d3b

Browse files
Fix -Wdouble-promotion warnings.
Reviewers: mclow.lists Subscribers: christof, ldionne, cfe-commits, libcxx-commits Differential Revision: https://reviews.llvm.org/D62782 llvm-svn: 364798
1 parent 9e9dd30 commit ba41d3b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

libcxx/include/limits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ protected:
409409
static _LIBCPP_CONSTEXPR const bool is_exact = false;
410410
static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__;
411411
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;}
412-
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;}
412+
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5L;}
413413

414414
static _LIBCPP_CONSTEXPR const int min_exponent = __LDBL_MIN_EXP__;
415415
static _LIBCPP_CONSTEXPR const int min_exponent10 = __LDBL_MIN_10_EXP__;

libcxx/include/utility

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<float>
14791479
size_t operator()(float __v) const _NOEXCEPT
14801480
{
14811481
// -0.0 and 0.0 should return same hash
1482-
if (__v == 0.0)
1482+
if (__v == 0.0f)
14831483
return 0;
14841484
return __scalar_hash<float>::operator()(__v);
14851485
}
@@ -1507,7 +1507,7 @@ struct _LIBCPP_TEMPLATE_VIS hash<long double>
15071507
size_t operator()(long double __v) const _NOEXCEPT
15081508
{
15091509
// -0.0 and 0.0 should return same hash
1510-
if (__v == 0.0)
1510+
if (__v == 0.0L)
15111511
return 0;
15121512
#if defined(__i386__)
15131513
// Zero out padding bits

0 commit comments

Comments
 (0)