O'Reilly logo

C Interfaces and Implementations: Techniques for Creating Reusable Software by David R. Hanson - Princeton University

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19. Multiple-Precision Arithmetic

The last of the three arithmetic interfaces, MP, exports functions that implement multiple-precision arithmetic on unsigned and two’s-complement integers. Like XP, MP reveals its representation for n-bit integers, and the MP functions operate on integers of a given size. Unlike XP, the lengths of MP’s integers are given in bits, and MP’s functions implement both signed and unsigned arithmetic. Like the AP functions, the MP functions enforce the usual suite of checked runtime errors.

MP is intended for applications that need extended-precision arithmetic, but want finer control over allocations, need both unsigned and signed operations, or must mimic two’s-complement n-bit arithmetic. Examples include compilers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required