[RFC] We need an ENTIER that does ceil, CENTIER?

Pietro Monteiro pietro.gcc@sociotechnical.xyz
Sat May 16 14:13:10 GMT 2026


On Sat, May 16, 2026, at 6:08 AM, Jose E. Marchesi wrote:
> Hello Paul.
>
>> On 16/05/2026 03:11, algol68-request@gcc.gnu.org wrote:
>>> Date: Fri, 15 May 2026 23:07:42 +0200
>>> From: "Jose E. Marchesi"<jemarch@gnu.org>
>>> To:algol68@gcc.gnu.org
>>> Subject: Re: [RFC] We need an ENTIER that does ceil, CENTIER?
>>> Message-ID:<871pfc5qld.fsf@gnu.org>
>>> Content-Type: text/plain
>>>
>>>
>>> Sooo, I found this in the PDP-11 ALGOL 68S manual:
>>>
>>> ----
>>> # Two flavors of real-to-integer conversion #
>>>
>>> round	1.6	yields	2	proc (real) int
>>> entier	1.6	yields	1	proc (real) int
>>> round	-1.4	yields	-1
>>> entier	-1.4	yields	-2
>>> ----
>>>
>>> They use ROUND for ceil.
>>>
>>> I suggest we do the same, as there is at least some established
>>> tradition about it..
>> I suggest not.  CEIL (or CEILING as second-best) unambiguously
>> indicates rounding up.  ROUND, to me at least, could mean round up,
>> round down or round to nearest.
>>
>> It gets worse.  On p16 of "An Introduction to Algol 68 through
>> Problems" by A Learner and AJ Powell (ISBN 0 33 16620 5)which uses
>> Algol 68-R for its examples we find:
>>
>>     'a := round x' assigns the nearest whole number to the value of x
>> to the integer a.
>>     'entier x is the greatest integer <= x.
>>
>> This tome uses Algol 68R.
>>
>> The explanation in "Algol 68-R Users Guide (ISBN 0 11 771600 6) is
>> somewhat more explicit  The text on page 93 reads:
>>
>>    ROUND   10   applied to REAL, gives the nearest INT. In critical
>> cases, round up.
>>
>> Pagan's "A Practical Guide to Algol 68' does not specify which
>> compiler is targeted but uses the "nearest whole number"
>> formulation. Genie does the same on page 220 of
>> https://algol68-lang.org/docs/learning-algol-68-genie.pdf
>>
>>
>> My take is that if we follow tradition in using ROUND we end up
>> getting an undesirable result half the time or have to remember to add
>> 0.5 before ROUNDing.
>
> Also, the ROUND of ALGOL 68R seems to be different than the ROUND of
> PDP11 ALGOL 68S.  Messy indeed..
>
>>
>> Mathematical usage in English is invariably floor and ceiling, likely
>> because of the ambiguity concern.  Given that ENTIER is already built
>> in to the language and yet is not used in any other language AFAIK, I
>> see relatively little attraction in the established tradition
>> argument.
>
> Thank you for the feedback.
>
> Nelson Beebe has also urged me to not use ROUND at all and to stick to
> CEIL and FLOOR instead.

ROUND is defined in RR  10.2.3.4.p basically as “round to nearest”, similar to
The XroundY in C.

So ALGOL 68R and Algol 68 Genie follow the RR and PDP11 ALGOL 68S
doesn’t.

We still need an operation to round up. I’d really love to use “arriba” for that.
But I realize not everybody is a goofy as I am.

pietro


More information about the Algol68 mailing list