CHAPTER 8C++ Numerics, IEEE 754 and Boost C++ Multiprecision

8.1 Introduction and Objectives

In this chapter we introduce a number of concepts, methods and C++ language features to promote the robustness and reliability of code. Specifically, robustness is the ability of a computer system to cope with errors during execution and cope with erroneous input while reliability is concerned with how a software system maintains a given level of performance over some given period of time. We discuss a number of techniques to promote robust programming. This can be defined as ‘a style of programming that focuses on handling unexpected termination and unexpected actions. It requires code to handle these terminations and actions gracefully by displaying accurate and unambiguous error messages. These error messages allow the user to more easily debug the program'. Reliability describes avoiding abnormal program termination. It has three sub-characteristics:

  • Maturity: has to do with the frequency of failure in the system. Most failures are caused by faults.
  • Fault tolerance: refers to the ability of the system to maintain a specified level of performance. We must specify the duration of time for which that level is to be maintained.
  • Recoverability: refers to the capability to re-establish previous levels of performance.

These are major concerns when writing C++ code that implements the numerical methods and algorithms in computational finance. In particular, we discuss a number of methods ...

Get Financial Instrument Pricing Using C++, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.