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

Remington Furman remington@remcycles.net
Sat May 16 13:49:01 GMT 2026


Tcl is where I first learned the word "entier".  Tcl 8.5 added support 
for arbitrary precision integers, with entier used to truncate such 
integers towards zero.  Existing function names didn't support arbitrary 
precision, so they borrowed a French word.

> entier arg
>     The argument may be any numeric value. The integer part of arg is 
> determined and returned. The integer range returned by this function 
> is unlimited, unlike int and wide which truncate their range to fit in 
> particular storage widths.

https://core.tcl-lang.org/tips/doc/trunk/tip/237.md

https://www.tcl-lang.org/man/tcl8.6/TclCmd/mathfunc.htm#M16

However, Tcl's "truncate towards zero" behavior does not match the 
French Wikipedia definition of "Partie entière" for negative values:
https://fr.wikipedia.org/wiki/Partie_enti%C3%A8re_et_partie_fractionnaire

Algol68's ENTIER does match the French definition.

English Wikipedia attributes "partie entière" to Legendre, but in that 
context it only applied to positive integers and was the same as floor.

https://en.wikipedia.org/wiki/Floor_and_ceiling_functions

The modern definition uses floor for negative values.  I find that 
surprising, because to me English "whole part" suggests truncate towards 
zero, not floor.  So I can see how the Tcl interpretation was made.

Iverson notation, both the brackets and the "floor" and "ceiling" names, 
was a useful contribution to this confusion.  But now I realize it has 
no notation or name for truncation towards 0.

-Remington

On 5/16/26 2:24 AM, Jan Claeys wrote:
> On Sat, 2026-05-16 at 09:28 +0100, Paul Leyland wrote:
>> Given that ENTIER is already built in
>> to the language and yet is not used in any other language AFAIK
> It was used in ALGOL 60 (where ALGOL 68 copied it from) and also exists
> in TCL:
>
> https://www.masswerk.at/algol60/modified_report.htm#A2:~:text=procedure-,entier
>
> https://wiki.tcl-lang.org/page/entier
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/algol68/attachments/20260516/85bee45f/attachment.htm>


More information about the Algol68 mailing list