Anonymous user
Arithmetic/Rational/Modula-2: Difference between revisions
m
prepare for inclusion as template
(Modula-2. Un-omitted!!) |
m (prepare for inclusion as template) |
||
(One intermediate revision by one other user not shown) | |||
Line 1:
<noinclude>{{collection|Rational Arithmetic}}</noinclude>
{{works with|FST Modula-2 v4.0|no object oriented code used}}
This is incomplete as the Perfect Numbers task has not been addressed.
;Definition Module
<lang modula2>DEFINITION MODULE Rational;
TYPE RAT = RECORD
Line 44:
PROCEDURE WriteRational( i : RAT );
END Rational.</lang>
;Implementation Module
<lang modula2>IMPLEMENTATION MODULE Rational;
Line 269:
END WriteRational;
END Rational.</lang>
;Test Program
<lang modula2>MODULE TestRat;
FROM InOut IMPORT WriteString, WriteLine;
Line 382 ⟶ 381:
WriteString("Press any key..."); WHILE NOT KeyPressed() DO END;
END TestRat.</lang>
|