[RFC] CEIL, FLOOR, ROUND returning REAL

Jose E. Marchesi jemarch@gnu.org
Mon May 18 07:22:02 GMT 2026


> Comments below...
>
> On Sun, May 17, 2026, 22:07 Pietro Monteiro <pietro@sociotechnical.xyz>
> wrote:
>
>> On Mon, May 18, 2026, at 12:39 AM, chris hermansen wrote:
>> > Piero and everyone,
>> >
>> > On Sun, May 17, 2026, 21:27 Pietro Monteiro <pietro@sociotechnical.xyz>
>> wrote:
>> >> While working on implementing CEIL I realized that CEIL, FLOOR, ROUND
>> >> return an integer of same SIZETY as the real operand. I fortunately
>> >> don't much involving floating point math, but I think that returning a
>> >> real of same SIZETY as the operand might be usefull. What do y'all
>> >> think?
>> >
>> > I think the length of the result should be the same as that of the
>> operand.
>> >
>> > But I'm not sure I'm following you completely; ENTIER returns an INT,
>> > LONG INT OR LONG LONG INT, not reals. But your subject line suggests
>> > you plan to return real results from CEIL, FLOOR, ROUND?
>>
>> I was trying to propose adding CEIL, FLOOR/ENTIER and ROUND that would
>> return
>> a real of the same length of the operand in addition to the ones that
>> return an integer.
>>
>
> I guess they would have to have distinguishing names? Like RCEIL etc?
>
> I could be wrong but declaring two operators with the same name both taking
> a real argument, one returning INT, the other returning real... How would
> the compiler decide which one is being called since INT can be widened to
> real when a real value is required?

That's indeed not allowed in the same range: the operands of two
operators with the same name cannot be firmly related.


More information about the Algol68 mailing list