py: Implement divmod, % and proper // for floating point.

Tested and working on unix and pyboard.
This commit is contained in:
Damien George
2014-09-13 18:43:09 +01:00
parent 5c6783496d
commit 8594ce2280
8 changed files with 150 additions and 18 deletions

View File

@@ -487,6 +487,7 @@ typedef struct _mp_obj_float_t {
} mp_obj_float_t;
mp_float_t mp_obj_float_get(mp_obj_t self_in);
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
void mp_obj_float_divmod(mp_float_t *x, mp_float_t *y);
// complex
void mp_obj_complex_get(mp_obj_t self_in, mp_float_t *real, mp_float_t *imag);