Arithmetic/Rational/Modula-3: Difference between revisions

m
Not sure what <noinclude> does, so I removed it.
(A first version)
 
m (Not sure what <noinclude> does, so I removed it.)
 
Line 1:
<noinclude>{{Rational Arithmetic}}</noinclude>
 
This implementation implements the task in a module named <code>Frac</code> that exports an opaque type named <code>T</code>, a standard Modula-3 practice. Although the task does not require it, the module also defines the exception <code>ZeroDenominator</code> for occasions when one might attempt division by zero, which includes at initialization. It provides two functions that return rational numbers for 0 and 1.
Anonymous user