TIP 745: Functions from C99

Login
 Author:         Donal K. Fellows <[email protected]>
 State:          Final
 Type:           Project
 Tcl-Version:    9.1
 Vote:           Done
 Created:        03-Jan-2026
 Keywords:       Tcl
 Tcl-Branch:     c11-functions
 Vote-Summary:   Accepted 8/0/0
 Votes-For:      DKF, HO, JN, KW, AN, MC, SL, AM

Abstract

C99 has many more standard functions than C89. We should give Tcl scripts access to that bounty.

Rationale

C99 has many functions for mathematical work, not all of which are already exposed (despite 521 covering a fair chunk of the space). We ought to make these available to Tcl scripts as the cost of doing so is generally very small.

Note that this set of functions does not substantially change between C99 and later versions of the C Standard (C11, C17 and C23).

Specification

The following commands are added to the tcl::mathfunc namespace, typically with an obvious mapping to the list on this page (after ignoring the complexities due to the different type system in C relative to Tcl):

In addition, these commands are added to the global namespace to represent functions that conceptually return multiple values:

Omitted Functions

The following are omitted for various reasons.

Implementation

See the c11-functions branch.

Copyright

This document has been placed in the public domain.