From a73501b1d63e5240cbced95b884383b79f5d6efd Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 6 Apr 2017 17:27:33 +1000 Subject: py/objfloat: Add implementation of high-quality float hashing. Disabled by default. --- py/obj.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'py/obj.h') diff --git a/py/obj.h b/py/obj.h index 597c7c8d9..b5a0c4190 100644 --- a/py/obj.h +++ b/py/obj.h @@ -730,7 +730,11 @@ void mp_str_print_quoted(const mp_print_t *print, const byte *str_data, size_t s #if MICROPY_PY_BUILTINS_FLOAT // float +#if MICROPY_FLOAT_HIGH_QUALITY_HASH +mp_int_t mp_float_hash(mp_float_t val); +#else static inline mp_int_t mp_float_hash(mp_float_t val) { return (mp_int_t)val; } +#endif mp_obj_t mp_obj_float_binary_op(mp_uint_t op, mp_float_t lhs_val, mp_obj_t rhs); // can return MP_OBJ_NULL if op not supported // complex -- cgit v1.2.3