Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003279 [Quercus] block always 01-17-09 12:43 01-18-09 09:32
Reporter koreth View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 4.0.0
Summary 0003279: Default floating-point formatting uses exponent notation too early
Description <?php
$x = 1.0;
while ($x < 100000000000000000000.0) {
  print $x . "\n";
  $x *= 10.1;
}

PHP prints:

1
10.1
102.01
1030.301
10406.0401
105101.00501
1061520.150601
10721353.52107
108285670.56281
1093685272.6844
11046221254.112
111566834666.53
1126825030132
11380932804333
114947421323760
1160968955370000
11725786449237000
118430443137290000
1.1961474756867E+18
1.2081089504435E+19

Quercus prints:

1
10.1
102.00999999999999
1030.301
10406.040099999998
105101.00500999998
1061520.1506009998
1.0721353521070099E7
1.0828567056280799E8
1.0936852726843607E9
1.1046221254112043E10
1.1156683466653163E11
1.1268250301319695E12
1.138093280433289E13
1.1494742132376219E14
1160968955369998
11725786449236980
118430443137293488
1196147475686664192
1.2081089504435309E19

The floating point errors are not a big deal (though rounding them to be output-compatible with PHP wouldn't hurt) but the fact that Quercus starts using exponent notation far earlier than PHP does is causing problems with some code that's expecting to be able to do simple parsing of floats within a particular range.
Additional Information
Attached Files

- Relationships

- Notes
(0003757)
ferg
01-18-09 09:32

php/1003
 

- Issue History
Date Modified Username Field Change
01-17-09 12:43 koreth New Issue
01-18-09 09:32 ferg Note Added: 0003757
01-18-09 09:32 ferg Assigned To  => ferg
01-18-09 09:32 ferg Status new => closed
01-18-09 09:32 ferg Resolution open => fixed
01-18-09 09:32 ferg Fixed in Version  => 4.0.0


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker