mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 12:09:18 +02:00
test for bug #1720
This commit is contained in:
parent
a85ff04815
commit
4726bde002
27
tests/webtbs/tw1720.pp
Normal file
27
tests/webtbs/tw1720.pp
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
{ Source provided for Free Pascal Bug Report 1720 }
|
||||||
|
{ Submitted by "Jesse Towner" on 2001-12-09 }
|
||||||
|
{ e-mail: jesse@gdnmail.net }
|
||||||
|
var a, b, c : single;
|
||||||
|
begin
|
||||||
|
(* ... other floating point code goes here *)
|
||||||
|
|
||||||
|
a := 5.6;
|
||||||
|
b := 3.4;
|
||||||
|
b:= b + sqrt(b)- ln(a);
|
||||||
|
|
||||||
|
c := a - (b-(b-1));
|
||||||
|
|
||||||
|
if abs(c-(a-1))>0.01 then
|
||||||
|
begin
|
||||||
|
Writeln('Error in floating point code');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
(* sometimes, depending on the previous code,
|
||||||
|
the code generator will chose to swap the
|
||||||
|
operands. however, it just calls the
|
||||||
|
reverse version of the instruction without
|
||||||
|
swapping the operands. this results in
|
||||||
|
giving a value of (b-a) or -2.2 for c. the
|
||||||
|
same goes for floating point division. *)
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user