py: Fix types in new math functions.

This commit is contained in:
Damien George 2014-03-22 20:44:15 +00:00
parent ffa37db5c5
commit 6280587320
1 changed files with 18 additions and 19 deletions

View File

@ -63,8 +63,8 @@ MATH_FUN_1(lgamma, lgamma)
// Functions that return a tuple
mp_obj_t mp_math_frexp(mp_obj_t x_obj) {
machine_int_t int_exponent = 0;
mp_float_t significand = frexp(mp_obj_get_float(x_obj), &int_exponent);
int int_exponent = 0;
mp_float_t significand = MICROPY_FLOAT_C_FUN(frexp)(mp_obj_get_float(x_obj), &int_exponent);
mp_obj_t tuple[2];
tuple[0] = mp_obj_new_float(significand);
tuple[1] = mp_obj_new_int(int_exponent);
@ -74,7 +74,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_math_frexp_obj, mp_math_frexp);
mp_obj_t mp_math_modf(mp_obj_t x_obj) {
mp_float_t int_part = 0.0;
mp_float_t fractional_part = modf(mp_obj_get_float(x_obj), &int_part);
mp_float_t fractional_part = MICROPY_FLOAT_C_FUN(modf)(mp_obj_get_float(x_obj), &int_part);
mp_obj_t tuple[2];
tuple[0] = mp_obj_new_float(fractional_part);
tuple[1] = mp_obj_new_float(int_part);
@ -93,7 +93,6 @@ mp_obj_t mp_math_degrees(mp_obj_t x_obj){
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(mp_math_degrees_obj, mp_math_degrees);
STATIC const mp_map_elem_t mp_module_math_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_math) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_e), (mp_obj_t)&mp_math_e_obj },