Range consolidation: Difference between revisions
→{{header|ALGOL 68}}: tweak
(Added Algol 68) |
(→{{header|ALGOL 68}}: tweak) |
||
Line 444:
# returns the consolidation of the ranges in a in #
OP
IF UPB a in <= LWB a in
THEN a in # 0 or 1 range #
Line 464:
OD;
result[ : r max ]
FI #
OP FMT = ( REAL v )STRING: # prints v with at most 3 decimal places #
Line 497:
PROC test = ( []RANGE a )VOID:
BEGIN print( ( ( TOSTRING a PAD 60 ), " -> ", TOSTRING
test( []RANGE( RANGE( 1.1, 2.2 ) ) );
test( ( ( 6.1, 7.2 ), ( 7.2, 8.3 ) ) );
|