mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-24 08:54:17 +00:00
Upload
Digital Research
This commit is contained in:
33
SAMPLE CODE/PLI PROG SAMPLE CODE/DECPOLY.PLI
Normal file
33
SAMPLE CODE/PLI PROG SAMPLE CODE/DECPOLY.PLI
Normal file
@@ -0,0 +1,33 @@
|
||||
/*****************************************************/
|
||||
/* This program evaluates a polynomial expression */
|
||||
/* using FIXED DECIMAL data. */
|
||||
/*****************************************************/
|
||||
decpoly:
|
||||
procedure options(main);
|
||||
|
||||
%replace
|
||||
true by '1'b;
|
||||
declare
|
||||
(x,y,z) fixed decimal(15,4);
|
||||
|
||||
do while(true);
|
||||
put skip(2) list('Type x,y,z: ');
|
||||
get list(x,y,z);
|
||||
|
||||
if x=0 & y=0 & z=0 then
|
||||
stop;
|
||||
|
||||
put skip list(' 2');
|
||||
put skip list(' x + 2y + z =',P(x,y,z));
|
||||
end;
|
||||
|
||||
P:
|
||||
procedure (x,y,z) returns (fixed decimal(15,4));
|
||||
declare
|
||||
(x,y,z) fixed decimal(15,4);
|
||||
return (x * x + 2 * y + z);
|
||||
end P;
|
||||
|
||||
end decpoly;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user