Title
div() for unsigned integral types
Status
nad
Section
[c.math]
Submitter
Beman Dawes

Created on 2006-06-15.00:00:00 last changed 168 months ago

Messages

Date: 2011-03-05.00:04:13

Rationale:

Toronto: C99 does not have these unsigned versions because the signed version exist just to define the implementation-defined behavior of signed integer division. Unsigned integer division has no implementation-defined behavior and thus does not need this treatment.

Date: 2010-10-21.18:28:33

Proposed resolution:

Add to 26.7 [lib.c.math] paragraph 8:

struct udiv_t div(unsigned, unsigned);
struct uldiv_t div(unsigned long, unsigned long);
struct ulldiv_t div(unsigned long long, unsigned long long);
Date: 2006-06-15.00:00:00

There is no div() function for unsigned integer types.

There are several possible resolutions. The simplest one is noted below. Other possibilities include a templated solution.

History
Date User Action Args
2011-03-05 00:04:13adminsetmessages: + msg5581
2010-10-21 18:28:33adminsetmessages: + msg3135
2006-06-15 00:00:00admincreate