TIP #294: The "entier" Function: It's Spelt "entire"


TIP:294
Title:The "entier" Function: It's Spelt "entire"
Version:$Revision: 1.4 $
Authors: Lars Hellström <Lars dot Hellstrom at residenset dot net>
Richard Suchenwirth <richard dot suchenwirth-bauersachs at siemens dot com>
State:Rejected
Type:Project
Tcl-Version:8.5
Vote:Done
Created:Friday, 03 November 2006
Keywords:Tcl, number, cast, rename

Abstract

It is proposed that the expr function entier() introduced by TIP #237 is renamed to entire().

Rationale

This appears to be a typo. Even though American English differs from British English in that many words which in the latter end in "-re" are spelt "-er", this is not one of these. Neither Merriam-Webster Online nor dictionary.com recognises "entier", whereas both list "entire". A Google search for "entier" reports 61400000 pages, but if one narrows it down to pages in English the count drops to 943000, and even then most of these are in fact written in French. Within the first 60 matches, only 3 show "entier" occurring in English text, and in all these cases it is part of a trademark/product name.

Googling for "entier function" shows however that it is a concept discussed in English texts. entier() was one of the standard functions in Algol 60.

Alternatives

While the term "entire" meaning "whole" is known in mathematics, it is rarely applied to numbers. The typical thing to be entire is instead a function [1], and that is quite unrelated to integers. Better names could be:

It could also be argued that the function is rather silly, since "coercing to integer" (which seems to be the same as truncation, i.e., rounding towards zero) is mathematically a rather useless operation. More useful operations are rounding to the nearest integer (available as round), floor (rounding downwards), and ceiling (rounding upwards), since these admit tight inequalities that do not depend on the sign of the number. Currently the two latter have to be had by combining round and floor/ceil, whereas separate functions ifloor and iceil would have been more appropriate. Getting them would however require actually implementing something new.

Implementation

This TIP can be implemented by applying the following command prefix to the contents of the files of the Tcl source tree:

 string map {entier entire Entier Entire}

(It may of course be more convenient to use the search and replace functionality of a text editor.) Grepping indicates that the only C file affected would be generic/tclBasic.c', the only Tcl files affected would be tests/expr.test and tests/info.test, and the only documentation file affected would be doc/mathfunc.n.

Copyright

This document has been placed in the public domain.


Powered by Tcl[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows