mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 04:39:22 +02:00
* fixed mantis 8434 (wrong precision used in case of |number| < 1,
which when multiplied by 10^x goes from 0.9y to 1.0z, and if a specific presision is specified) git-svn-id: trunk@6692 -
This commit is contained in:
parent
025b57815f
commit
e44a9ca4cb
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8052,6 +8052,7 @@ tests/webtbs/tw8312.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw8321.pp svneol=native#text/plain
|
tests/webtbs/tw8321.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8371.pp svneol=native#text/plain
|
tests/webtbs/tw8371.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8391.pp svneol=native#text/plain
|
tests/webtbs/tw8391.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw8434.pp svneol=native#text/plain
|
||||||
tests/webtbs/ub1873.pp svneol=native#text/plain
|
tests/webtbs/ub1873.pp svneol=native#text/plain
|
||||||
tests/webtbs/ub1883.pp svneol=native#text/plain
|
tests/webtbs/ub1883.pp svneol=native#text/plain
|
||||||
tests/webtbs/uw0555.pp svneol=native#text/plain
|
tests/webtbs/uw0555.pp svneol=native#text/plain
|
||||||
|
@ -384,7 +384,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
roundStr(temp,spos);
|
roundStr(temp,spos);
|
||||||
d := frac(d);
|
d := frac(d);
|
||||||
dec(currprec);
|
if (f < 0) then
|
||||||
|
dec(currprec);
|
||||||
end;
|
end;
|
||||||
{ calculate the necessary fractional digits }
|
{ calculate the necessary fractional digits }
|
||||||
for fracCount := 1 to currPrec do
|
for fracCount := 1 to currPrec do
|
||||||
|
11
tests/webtbs/tw8434.pp
Normal file
11
tests/webtbs/tw8434.pp
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
uses sysutils;
|
||||||
|
|
||||||
|
var
|
||||||
|
x: double;
|
||||||
|
begin
|
||||||
|
x := 0.099991;
|
||||||
|
if (Format('%5.2f', [x]) <> ' 0.10') then
|
||||||
|
halt(1);
|
||||||
|
if (Format('%6.3f', [x]) <> ' 0.100') then
|
||||||
|
halt(2);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user