diff options
author | John R. Lenton <jlenton@gmail.com> | 2014-01-11 00:58:59 +0000 |
---|---|---|
committer | John R. Lenton <jlenton@gmail.com> | 2014-01-11 00:58:59 +0000 |
commit | b8698fca75018b5cacaf9b2fdfd821f86b8acaf4 (patch) | |
tree | 714b75f2779b79b826d745c13f725835001f787f /py/objfloat.c | |
parent | ad97f2a49ea723cf21f828c99e0075ff1fd0680a (diff) |
unified the bops
Diffstat (limited to 'py/objfloat.c')
-rw-r--r-- | py/objfloat.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/py/objfloat.c b/py/objfloat.c index 283285b07..bb44ac954 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -99,6 +99,12 @@ mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs_in) { */ case RT_BINARY_OP_TRUE_DIVIDE: case RT_BINARY_OP_INPLACE_TRUE_DIVIDE: lhs_val /= rhs_val; break; + + case RT_COMPARE_OP_LESS: return MP_BOOL(lhs_val < rhs_val); + case RT_COMPARE_OP_MORE: return MP_BOOL(lhs_val > rhs_val); + case RT_COMPARE_OP_LESS_EQUAL: return MP_BOOL(lhs_val <= rhs_val); + case RT_COMPARE_OP_MORE_EQUAL: return MP_BOOL(lhs_val >= rhs_val); + return NULL; // op not supported } return mp_obj_new_float(lhs_val); |