@@ -83,6 +83,17 @@ static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
8383#define MP_OBJ_QSTR_VALUE (o ) (((mp_uint_t)(o)) >> 2)
8484#define MP_OBJ_NEW_QSTR (qst ) ((mp_obj_t)((((mp_uint_t)(qst)) << 2) | 2))
8585
86+ #if MICROPY_PY_BUILTINS_FLOAT
87+ #define mp_const_float_e ((mp_obj_t)&mp_const_float_e_obj)
88+ #define mp_const_float_pi ((mp_obj_t)&mp_const_float_pi_obj)
89+ extern const struct _mp_obj_float_t mp_const_float_e_obj ;
90+ extern const struct _mp_obj_float_t mp_const_float_pi_obj ;
91+
92+ #define mp_obj_is_float (o ) MP_OBJ_IS_TYPE((o), &mp_type_float)
93+ mp_float_t mp_obj_float_get (mp_obj_t self_in );
94+ mp_obj_t mp_obj_new_float (mp_float_t value );
95+ #endif
96+
8697static inline bool MP_OBJ_IS_OBJ (mp_const_obj_t o )
8798 { return ((((mp_int_t )(o )) & 3 ) == 0 ); }
8899
@@ -98,6 +109,17 @@ static inline bool MP_OBJ_IS_QSTR(mp_const_obj_t o)
98109#define MP_OBJ_QSTR_VALUE (o ) (((mp_uint_t)(o)) >> 2)
99110#define MP_OBJ_NEW_QSTR (qst ) ((mp_obj_t)((((mp_uint_t)(qst)) << 2) | 3))
100111
112+ #if MICROPY_PY_BUILTINS_FLOAT
113+ #define mp_const_float_e ((mp_obj_t)&mp_const_float_e_obj)
114+ #define mp_const_float_pi ((mp_obj_t)&mp_const_float_pi_obj)
115+ extern const struct _mp_obj_float_t mp_const_float_e_obj ;
116+ extern const struct _mp_obj_float_t mp_const_float_pi_obj ;
117+
118+ #define mp_obj_is_float (o ) MP_OBJ_IS_TYPE((o), &mp_type_float)
119+ mp_float_t mp_obj_float_get (mp_obj_t self_in );
120+ mp_obj_t mp_obj_new_float (mp_float_t value );
121+ #endif
122+
101123static inline bool MP_OBJ_IS_OBJ (mp_const_obj_t o )
102124 { return ((((mp_int_t )(o )) & 1 ) == 0 ); }
103125
@@ -473,7 +495,6 @@ mp_obj_t mp_obj_new_bytearray(mp_uint_t n, void *items);
473495mp_obj_t mp_obj_new_bytearray_by_ref (mp_uint_t n , void * items );
474496#if MICROPY_PY_BUILTINS_FLOAT
475497mp_obj_t mp_obj_new_int_from_float (mp_float_t val );
476- mp_obj_t mp_obj_new_float (mp_float_t val );
477498mp_obj_t mp_obj_new_complex (mp_float_t real , mp_float_t imag );
478499#endif
479500mp_obj_t mp_obj_new_exception (const mp_obj_type_t * exc_type );
@@ -564,13 +585,6 @@ void mp_str_print_quoted(const mp_print_t *print, const byte *str_data, mp_uint_
564585
565586#if MICROPY_PY_BUILTINS_FLOAT
566587// float
567- #define mp_const_float_e ((mp_obj_t)&mp_const_float_e_obj)
568- #define mp_const_float_pi ((mp_obj_t)&mp_const_float_pi_obj)
569- extern const struct _mp_obj_float_t mp_const_float_e_obj ;
570- extern const struct _mp_obj_float_t mp_const_float_pi_obj ;
571-
572- #define mp_obj_is_float (o ) MP_OBJ_IS_TYPE((o), &mp_type_float)
573- mp_float_t mp_obj_float_get (mp_obj_t self_in );
574588mp_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
575589
576590// complex
0 commit comments