N4038: Proposal for Unbounded-Precision Integer Types -- Pete Becker

A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4038

Date: 2014-05-23

Proposal for Unbounded-Precision Integer Types

by Pete Becker

Excerpt:

What’s New in this Revision

  • In integer, replaced constructors taking arithmetic types with a templated constructor and added a templated assignment operator for arithmetic types. In bits, replaced constructors taking integral types with a templated constructor and added a templated assignment operator for integral types.
  • Added integer::is_zero.
  • Added noexcept to unary integer::operator- and unary integer::operator+.
  • Added several issues raised by Marc Glisse.

Overview

Programmers sometimes need to manipulate integer values that are too large to repesent with C++’s standard integer types. Doing a Google search for terms that describe large integers produces many hits for libraries that handle large integers. These libraries vary in quality, from hacks by beginners to sophisticated, professional implementations. Also, Java has unbounded precision integers as part of its standard class library.

One important use for unbounded-precision integers is cryptography. Cryptographic applications typically manipulate integer values of several hundred digits. If the C++ standard library provides facilities for such values it will make cryptographic applications easier to write and to port. ...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.