mirror of git://gcc.gnu.org/git/gcc.git
hash-long-double-aux.cc (hash<long double>:: operator()(long double)): Hash both -0 and +0 to 0.
2010-02-28 Paolo Carlini <paolo.carlini@oracle.com> * src/hash-long-double-aux.cc (hash<long double>:: operator()(long double)): Hash both -0 and +0 to 0. From-SVN: r157120
This commit is contained in:
parent
91ad7e13d1
commit
bea9840ef1
|
@ -1,3 +1,8 @@
|
|||
2010-02-28 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* src/hash-long-double-aux.cc (hash<long double>::
|
||||
operator()(long double)): Hash both -0 and +0 to 0.
|
||||
|
||||
2010-02-25 Ed Smith-Rowland <3dw4rd@verizon.net>
|
||||
|
||||
* include/bits/random.tcc (operator<<): Use max_digits10.
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
size_t
|
||||
hash<long double>::operator()(long double __val) const
|
||||
{
|
||||
size_t __result = 0;
|
||||
// 0 and -0 both hash to zero.
|
||||
if (__val == 0.0L)
|
||||
return 0;
|
||||
|
||||
int __exponent;
|
||||
__val = __builtin_frexpl(__val, &__exponent);
|
||||
|
@ -44,7 +46,5 @@
|
|||
|
||||
const size_t __coeff = __SIZE_MAX__ / __LDBL_MAX_EXP__;
|
||||
|
||||
__result = __hibits + (size_t)__val + __coeff * __exponent;
|
||||
|
||||
return __result;
|
||||
return __hibits + (size_t)__val + __coeff * __exponent;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue