… | |
… | |
260 | } |
260 | } |
261 | |
261 | |
262 | // this relies greatly on the quality of the pow () |
262 | // this relies greatly on the quality of the pow () |
263 | // implementation of the platform, but a good |
263 | // implementation of the platform, but a good |
264 | // implementation is hard to beat. |
264 | // implementation is hard to beat. |
|
|
265 | // (IEEE 754 conformant ones are required to be exact) |
265 | if (postdp) *expo -= eaccum; |
266 | if (postdp) *expo -= eaccum; |
266 | *accum += uaccum * Perl_pow (10., *expo); |
267 | *accum += uaccum * Perl_pow (10., *expo); |
267 | *expo += eaccum; |
268 | *expo += eaccum; |
268 | } |
269 | } |
269 | |
270 | |
… | |
… | |
1520 | { |
1521 | { |
1521 | dec_t dec; |
1522 | dec_t dec; |
1522 | SV *sv; |
1523 | SV *sv; |
1523 | |
1524 | |
1524 | /* work around bugs in 5.10 where manipulating magic values |
1525 | /* work around bugs in 5.10 where manipulating magic values |
1525 | * will perl ignore the magic in subsequent accesses |
1526 | * will perl ignore the magic in subsequent accesses. |
|
|
1527 | * also make a copy of non-PV values, to get them into a clean |
|
|
1528 | * state (SvPV should do that, but it's buggy, see below). |
1526 | */ |
1529 | */ |
1527 | /*SvGETMAGIC (string);*/ |
1530 | /*SvGETMAGIC (string);*/ |
1528 | if (SvMAGICAL (string)) |
1531 | if (SvMAGICAL (string) || !SvPOK (string)) |
1529 | string = sv_2mortal (newSVsv (string)); |
1532 | string = sv_2mortal (newSVsv (string)); |
1530 | |
1533 | |
1531 | SvUPGRADE (string, SVt_PV); |
1534 | SvUPGRADE (string, SVt_PV); |
1532 | |
1535 | |
1533 | /* work around a bug in perl 5.10, which causes SvCUR to fail an |
1536 | /* work around a bug in perl 5.10, which causes SvCUR to fail an |