View Issue Details

IDProjectCategoryView StatusLast Update
0037799FPCFCLpublic2020-11-13 21:41
ReporterYiannis Dondos Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.0 
Fixed in Version3.3.1 
Summary0037799: Bad output for FormatFloat
DescriptionExponent part for small values looks wrong (minus sign appears twice). Big values look good. Tested on Win32/i386 and Linux/amd64.
TagsNo tags attached.
Fixed in Revision47409
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

Yiannis Dondos

2020-09-22 22:41

reporter  

testexpo.pas (212 bytes)   
program testexpo;

uses SysUtils;

begin
     writeln (FormatFloat ('0.000E+000', 0.0012345)); // prints 1,235E-0-3 (incorrect)
     writeln (FormatFloat ('0.000E+000', 12345.67)); // prints 1,235E+004 (ok)
end.
testexpo.pas (212 bytes)   

jamie philbrook

2020-09-22 22:48

reporter   ~0125764

I believe that is the same issue that was reported before and a fix was offered but I don't think it went anywhere, at least I didn't see it being accepted or even discussed.

I believe @WP was at the helm on this one

Marco van de Voort

2020-09-22 23:00

manager   ~0125765

Last edited: 2020-09-22 23:00

View 2 revisions

Still happens in FPC 3.2.1 as of yesterday, fixed in trunk.

Possibly

r46778 | jonas | 2020-09-05 20:44:57 +0200 (Sat, 05 Sep 2020) | 2 lines
Changed paths:
   M /trunk/rtl/objpas/sysutils/fmtflt.inc
   A /trunk/tests/test/units/sysutils/tw37374.pp

  * fix formatfloat for 0 in exponential format (based on patch by
    Jamie Philbrook, mantis 0037374)

jamie philbrook

2020-09-23 02:17

reporter   ~0125766

I guess it didn't get merged to 3.2.x, maybe this can be done ?

Michael Van Canneyt

2020-11-13 21:41

administrator   ~0126893

Merged to fixes_3_2, so should be in 3.2.2

Issue History

Date Modified Username Field Change
2020-09-22 22:41 Yiannis Dondos New Issue
2020-09-22 22:41 Yiannis Dondos File Added: testexpo.pas
2020-09-22 22:48 jamie philbrook Note Added: 0125764
2020-09-22 23:00 Marco van de Voort Note Added: 0125765
2020-09-22 23:00 Marco van de Voort Note Edited: 0125765 View Revisions
2020-09-23 02:17 jamie philbrook Note Added: 0125766
2020-11-13 21:41 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-11-13 21:41 Michael Van Canneyt Status new => resolved
2020-11-13 21:41 Michael Van Canneyt Resolution open => fixed
2020-11-13 21:41 Michael Van Canneyt Fixed in Version => 3.3.1
2020-11-13 21:41 Michael Van Canneyt Fixed in Revision => 47409
2020-11-13 21:41 Michael Van Canneyt FPCTarget => 3.2.2
2020-11-13 21:41 Michael Van Canneyt Note Added: 0126893