View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037935 | FPC | Compiler | public | 2020-10-16 22:50 | 2020-10-16 23:07 |
Reporter | Benito van der Zander | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | no change required | ||
Platform | amd64 | OS | linux | ||
Product Version | 3.3.1 | ||||
Summary | 0037935: low precision floating point constants | ||||
Description | Some floating point constants are treated as single when they used to have more precision | ||||
Steps To Reproduce | begin writeln(double(StrToFloat('1')) / double(StrToFloat('3.0'))); writeln(double(1 / double(3.0))); writeln((1 / double(3.0))); writeln(double(1 / 3)); writeln(double(1 / 3.0)); writeln(double(1 / 3.0):22:22); writeln((1 / 3.0)); writeln((1 / single(3.0))); end. In 3.0.4 it prints very pretty: 3.3333333333333331E-001 3.3333333333333333E-001 3.3333333333333333E-001 3.3333333333333333E-001 3.3333333333333333E-001 0.3333333333333333300000 3.333333333E-01 3.333333333E-01 in trunk r47006 it prints: 3.3333333333333331E-001 3.3333333333333331E-001 3.3333333333333331E-001 3.3333333333333331E-001 3.3333334326744080E-001 0.3333333432674408000000 3.333333433E-01 3.333333433E-01 Guess the last two are valid ways to print a single 1/3, but why is double(1 / 3.0) calculated with single precision? | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2020-10-16 22:50 | Benito van der Zander | New Issue | |
2020-10-16 23:07 | Florian | Assigned To | => Florian |
2020-10-16 23:07 | Florian | Status | new => resolved |
2020-10-16 23:07 | Florian | Resolution | open => no change required |
2020-10-16 23:07 | Florian | FPCTarget | => - |
2020-10-16 23:07 | Florian | Note Added: 0126355 |