*** tmp/parrot/src/string.c Sat Mar 6 03:00:06 2004
--- parrot/src/string.c Wed Mar 17 16:05:50 2004
***************
*** 1836,1844 ****
int exp_sign = 0;
INTVAL in_exp = 0;
INTVAL in_number = 0;
! FLOATVAL exponent = 0;
INTVAL fake_exponent = 0;
INTVAL digit_family = 0;
while (start < end) {
UINTVAL c = s->encoding->decode(start);
--- 1836,1845 ----
int exp_sign = 0;
INTVAL in_exp = 0;
INTVAL in_number = 0;
! INTVAL exponent = 0;
INTVAL fake_exponent = 0;
INTVAL digit_family = 0;
+ FLOATVAL exp_log=10.0, exp_val=1.0;
while (start < end) {
UINTVAL c = s->encoding->decode(start);
***************
*** 1849,1855 ****
if (df && df == digit_family) {
if (in_exp) {
! exponent = exponent * 10 + s->type->get_digit(s->type,c);
if (!exp_sign) {
exp_sign = 1;
}
--- 1850,1856 ----
if (df && df == digit_family) {
if (in_exp) {
! exponent = exponent*10 + s->type->get_digit(s->type,c);
if (!exp_sign) {
exp_sign = 1;
}
***************
*** 1906,1912 ****
exponent = fake_exponent + exponent * exp_sign;
! f = f * sign * pow(10.0, exponent); /* ugly, oh yeah */
}
return f;
--- 1907,1936 ----
exponent = fake_exponent + exponent * exp_sign;
! if(exponent < 0) {
! exponent = -exponent;
! exp_sign=-1;
! }
!
! for (;;) {
! if (exponent & 1) {
! exp_val *= exp_log;
! exponent--;
! }
! if (!exponent)
! break;
! exp_log *= exp_log;
! exponent >>= 1;
! }
!
! if(exp_sign < 0)
! f /= exp_val;
! else
! f *= exp_val;
!
!
! if(sign < 0)
! f = -f;
}
return f;
Oops, use this one instead... "re"-fixes the exponent support...
- [perl #27690] Numeric comparison bug via RT
- Re: [perl #27690] Numeric comparison bug Leopold Toetsch
- Re: [perl #27690] Numeric comparison bug Simon Glover
- Re: [perl #27690] Numeric comparison... Larry Wall
- Re: [perl #27690] Numeric compar... Leopold Toetsch
- Re: [perl #27690] Numeric comparison bug S. Livingston
- Re: [perl #27690] Numeric comparison... S. Livingston
- Re: [perl #27690] Numeric compar... Larry Wall
- Re: [perl #27690] Numeric c... Skip Livingston
- Re: [perl #27690] Numer... Leopold Toetsch
- Re: [perl #27690] Numeric compar... Leopold Toetsch
- Re: [perl #27690] Numeric c... Brent 'Dax' Royal-Gordon
- Re: [perl #27690] Numer... Leopold Toetsch
- scanf (was Re: [per... Uri Guttman
- Re: [perl #27690] N... Brent 'Dax' Royal-Gordon
- Re: [perl #27690] Numeric comparison bug mark . a . biggar
- Re: [perl #27690] Numeric comparison bug Leopold Toetsch
