File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -184,12 +184,13 @@ static inline bool mp_obj_is_small_int(mp_const_obj_t o) {
184184#define MP_OBJ_NEW_SMALL_INT (small_int ) ((mp_obj_t)((((mp_uint_t)(small_int)) << 1) | 1))
185185
186186#if MICROPY_PY_BUILTINS_FLOAT
187- #define mp_const_float_e MP_ROM_PTR((mp_obj_t)(((0x402df854 & ~3) | 2) + 0x80800000))
188- #define mp_const_float_pi MP_ROM_PTR((mp_obj_t)(((0x40490fdb & ~3) | 2) + 0x80800000))
187+ #define MP_OBJ_NEW_CONST_FLOAT (f ) MP_ROM_PTR((mp_obj_t)((((((uint64_t)f) & ~3) | 2) + 0x80800000) & 0xffffffff))
188+ #define mp_const_float_e MP_OBJ_NEW_CONST_FLOAT(0x402df854)
189+ #define mp_const_float_pi MP_OBJ_NEW_CONST_FLOAT(0x40490fdb)
189190#if MICROPY_PY_MATH_CONSTANTS
190- #define mp_const_float_tau MP_ROM_PTR((mp_obj_t)((( 0x40c90fdb & ~3) | 2) + 0x80800000) )
191- #define mp_const_float_inf MP_ROM_PTR((mp_obj_t)((( 0x7f800000 & ~3) | 2) + 0x80800000) )
192- #define mp_const_float_nan MP_ROM_PTR((mp_obj_t)((( 0xffc00000 & ~3) | 2) + 0x80800000) )
191+ #define mp_const_float_tau MP_OBJ_NEW_CONST_FLOAT( 0x40c90fdb)
192+ #define mp_const_float_inf MP_OBJ_NEW_CONST_FLOAT( 0x7f800000)
193+ #define mp_const_float_nan MP_OBJ_NEW_CONST_FLOAT( 0xffc00000)
193194#endif
194195
195196static inline bool mp_obj_is_float (mp_const_obj_t o ) {
You can’t perform that action at this time.
0 commit comments