mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 17:04:19 +00:00
Upload
Digital Research
This commit is contained in:
39
SAMPLE CODE/PLI PROG SAMPLE CODE/FLTPOLY2.PLI
Normal file
39
SAMPLE CODE/PLI PROG SAMPLE CODE/FLTPOLY2.PLI
Normal file
@@ -0,0 +1,39 @@
|
||||
/******************************************************/
|
||||
/* This program evaluates a polynomial expression */
|
||||
/* using FLOAT BINARY data. It also traps the end-of */
|
||||
/* file condition for the file SYSIN. */
|
||||
/******************************************************/
|
||||
fltpoly2:
|
||||
procedure options(main);
|
||||
%replace
|
||||
false by '0'b,
|
||||
true by '1'b;
|
||||
declare
|
||||
(x,y,z) float binary(24),
|
||||
eofile bit(1) static initial(false),
|
||||
sysin file;
|
||||
|
||||
on endfile(sysin)
|
||||
eofile = true;
|
||||
|
||||
do while(true);
|
||||
put skip(2) list('Type x,y,z: ');
|
||||
get list(x,y,z);
|
||||
|
||||
if eofile then
|
||||
stop;
|
||||
|
||||
put skip list(' 2');
|
||||
put skip list(' x + 2y + z =',P(x,y,z));
|
||||
end;
|
||||
|
||||
P:
|
||||
procedure (x,y,z) returns (float binary(24));
|
||||
declare
|
||||
(x,y,z) float binary(24);
|
||||
return (x * x + 2 * y + z);
|
||||
end P;
|
||||
|
||||
end fltpoly2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user