mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-20 19:42:30 -08:00
(SXHASH -0.0) != (SXHASH 0.0)
This commit is contained in:
parent
020af55b65
commit
e6b3b6d944
2 changed files with 31 additions and 0 deletions
|
|
@ -29,6 +29,8 @@ ECL 9.1.0:
|
|||
- (FLOOR X X), (CEILING X X), etc, might return a second value which is a
|
||||
signed zero if X is a float with a negative sign.
|
||||
|
||||
- (SXHASH -0.0) != (SXHASH 0.0)
|
||||
|
||||
;;; Local Variables: ***
|
||||
;;; mode:text ***
|
||||
;;; fill-column:79 ***
|
||||
|
|
|
|||
29
src/c/hash.d
29
src/c/hash.d
|
|
@ -117,6 +117,35 @@ _hash_equal(int depth, cl_hashkey h, cl_object x)
|
|||
return hash_string(h, x->vector.self.ch, x->vector.fillp / 8);
|
||||
case t_random:
|
||||
return _hash_equal(0, h, x->random.value);
|
||||
#ifdef ECL_SIGNED_ZERO
|
||||
# ifdef ECL_SHORT_FLOAT
|
||||
case t_shortfloat: {
|
||||
float f = ecl_short_float(x);
|
||||
return hash_string(h, (unsigned char*)&f, sizeof(f));
|
||||
}
|
||||
# endif
|
||||
case t_singlefloat: {
|
||||
float f = sf(x);
|
||||
if (f == 0.0) f = 0.0;
|
||||
return hash_string(h, (unsigned char*)&f, sizeof(f));
|
||||
}
|
||||
case t_doublefloat: {
|
||||
double f = df(x);
|
||||
if (f == 0.0) f = 0.0;
|
||||
return hash_string(h, (unsigned char*)&f, sizeof(f));
|
||||
}
|
||||
# ifdef ECL_LONG_FLOAT
|
||||
case t_longfloat: {
|
||||
long double f = ecl_long_float(x);
|
||||
if (f == 0.0) f = 0.0;
|
||||
return hash_string(h, (unsigned char*)&f, sizeof(f));
|
||||
}
|
||||
# endif
|
||||
case t_complex: {
|
||||
h = _hash_equal(depth, h, x->complex.real);
|
||||
return _hash_equal(depth, h, x->complex.imag);
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
return _hash_eql(h, x);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue