diff --git a/src/string/api.c b/src/string/api.c index 339cc1d..40995b3 100644 --- a/src/string/api.c +++ b/src/string/api.c @@ -2315,19 +2315,28 @@ Parrot_str_to_num(PARROT_INTERP, ARGIN(const STRING *s)) return 0.0; } +/* local macro to call proper pow version depending on FLOATVAL */ +#if NUMVAL_SIZE == DOUBLE_SIZE +# define POW pow +#else +# define POW powl +#endif + if (d && d_is_safe) { - f = mantissa + (1.0 * d / powl(10, d_length)); + f = mantissa + (1.0 * d / POW(10.0, d_length)); } f = f * sign; if (e) { if (e_sign == 1) - f *= powl(10, e); + f *= POW(10.0, e); else - f /= powl(10, e); + f /= POW(10.0, e); } +#undef POW + return f; }