py: Wrap mpz float functions in MICROPY_ENABLE_FLOAT.

This commit is contained in:
Damien George
2014-03-08 15:04:54 +00:00
parent fdf0da5436
commit 5260810d70
3 changed files with 13 additions and 6 deletions

View File

@@ -1001,8 +1001,9 @@ machine_int_t mpz_as_int(const mpz_t *i) {
return val;
}
machine_float_t mpz_as_float(const mpz_t *i) {
machine_float_t val = 0;
#if MICROPY_ENABLE_FLOAT
mp_float_t mpz_as_float(const mpz_t *i) {
mp_float_t val = 0;
mpz_dig_t *d = i->dig + i->len;
while (--d >= i->dig) {
@@ -1015,6 +1016,7 @@ machine_float_t mpz_as_float(const mpz_t *i) {
return val;
}
#endif
uint mpz_as_str_size(const mpz_t *i, uint base) {
if (base < 2 || base > 32) {