1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 4<title>Safe Numerics</title> 5<link rel="stylesheet" href="boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="Safe Numerics"> 8<link rel="next" href="introduction.html" title="Introduction"> 9</head> 10<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 11<table cellpadding="2" width="100%"><tr> 12<td valign="top"><img href="index.html" height="164px" src="pre-boost.jpg" alt="Library Documentation Index"></td> 13<td><h2>Safe Numerics</h2></td> 14</tr></table> 15<div class="spirit-nav"><a accesskey="n" href="introduction.html"><img src="images/next.png" alt="Next"></a></div> 16<div class="chapter"> 17<div class="titlepage"><div> 18<div><h2 class="title"> 19<a name="safe_numerics"></a>Safe Numerics</h2></div> 20<div><div class="author"><h3 class="author"> 21<span class="firstname">Robert</span> <span class="surname">Ramey</span> 22</h3></div></div> 23<div><p class="copyright">Copyright © 2012-2018 Robert Ramey</p></div> 24<div><div class="legalnotice"> 25<a name="idm130210170320"></a><p><a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">Subject to Boost 26 Software License</a></p> 27</div></div> 28</div></div> 29<div class="toc"> 30<p><b>Table of Contents</b></p> 31<dl class="toc"> 32<dt><span class="section"><a href="introduction.html">Introduction</a></span></dt> 33<dd><dl> 34<dt><span class="section"><a href="introduction.html#safe_numerics.introduction.problem">Problem</a></span></dt> 35<dt><span class="section"><a href="introduction.html#safe_numerics.introduction.solution">Solution</a></span></dt> 36<dt><span class="section"><a href="introduction.html#safe_numerics.introduction.implementation">How It Works</a></span></dt> 37<dt><span class="section"><a href="introduction.html#safe_numerics.introduction.additional_features">Additional Features</a></span></dt> 38<dt><span class="section"><a href="introduction.html#safe_numerics.introduction.requirements">Requirements</a></span></dt> 39<dt><span class="section"><a href="introduction.html#safe_numerics.introduction.scope">Scope</a></span></dt> 40</dl></dd> 41<dt><span class="section"><a href="tutorial.html">Tutorial and Motivating Examples</a></span></dt> 42<dd><dl> 43<dt><span class="section"><a href="tutorial/1.html">Arithmetic Expressions Can Yield Incorrect Results</a></span></dt> 44<dt><span class="section"><a href="tutorial/2.html">Arithmetic Operations Can Overflow Silently</a></span></dt> 45<dt><span class="section"><a href="tutorial/3.html">Arithmetic on Unsigned Integers Can Yield Incorrect Results</a></span></dt> 46<dt><span class="section"><a href="tutorial/4.html">Implicit Conversions Can Lead to Erroneous Results</a></span></dt> 47<dt><span class="section"><a href="tutorial/5.html">Mixing Data Types Can Create Subtle Errors</a></span></dt> 48<dt><span class="section"><a href="tutorial/6.html">Array Index Value Can Exceed Array Limits</a></span></dt> 49<dt><span class="section"><a href="tutorial/7.html">Checking of Input Values Can Be Easily Overlooked</a></span></dt> 50<dt><span class="section"><a href="tutorial/8.html">Cannot Recover From Arithmetic Errors</a></span></dt> 51<dt><span class="section"><a href="tutorial/9.html">Compile Time Arithmetic is Not Always Correct</a></span></dt> 52<dt><span class="section"><a href="tutorial/10.html">Programming by Contract is Too Slow</a></span></dt> 53</dl></dd> 54<dt><span class="section"><a href="eliminate_runtime_penalty.html">Eliminating Runtime Penalty</a></span></dt> 55<dd><dl> 56<dt><span class="section"><a href="eliminate_runtime_penalty/2.html">Using safe_range 57 and safe_literal</a></span></dt> 58<dt><span class="section"><a href="eliminate_runtime_penalty/1.html">Using Automatic Type Promotion</a></span></dt> 59<dt><span class="section"><a href="eliminate_runtime_penalty/3.html">Mixing Approaches</a></span></dt> 60</dl></dd> 61<dt><span class="section"><a href="case_studies.html">Case Studies</a></span></dt> 62<dd><dl> 63<dt><span class="section"><a href="composition_with_other_libraries.html">Composition with Other Libraries</a></span></dt> 64<dt><span class="section"><a href="safety_critical_embedded_controller.html">Safety Critical Embedded Controller</a></span></dt> 65</dl></dd> 66<dt><span class="section"><a href="notes.html">Background</a></span></dt> 67<dt><span class="section"><a href="concepts.html">Type Requirements</a></span></dt> 68<dd><dl> 69<dt><span class="section"><a href="numeric.html">Numeric<T></a></span></dt> 70<dt><span class="section"><a href="integer.html">Integer<T></a></span></dt> 71<dt><span class="section"><a href="safe_numeric_concept.html">SafeNumeric<T></a></span></dt> 72<dt><span class="section"><a href="promotion_policy.html">PromotionPolicy<PP></a></span></dt> 73<dt><span class="section"><a href="exception_policy.html">ExceptionPolicy<EP></a></span></dt> 74</dl></dd> 75<dt><span class="section"><a href="types.html">Types</a></span></dt> 76<dd><dl> 77<dt><span class="section"><a href="safe.html">safe<T, PP, EP></a></span></dt> 78<dt><span class="section"><a href="safe_range.html">safe_signed_range<MIN, MAX, PP, EP> and 79 safe_unsigned_range<MIN, MAX, PP, EP></a></span></dt> 80<dt><span class="section"><a href="safe_literal.html">safe_signed_literal<Value, PP , EP> and 81 safe_unsigned_literal<Value, PP, EP></a></span></dt> 82<dt><span class="section"><a href="exception.html">exception</a></span></dt> 83<dt><span class="section"><a href="exception_policies.html">exception_policy<AE, IDB, UB, UV></a></span></dt> 84<dt><span class="section"><a href="promotion_policies.html">Promotion Policies</a></span></dt> 85</dl></dd> 86<dt><span class="section"><a href="exception_safety.html">Exception Safety</a></span></dt> 87<dt><span class="section"><a href="library_implementation.html">Library Implementation</a></span></dt> 88<dd><dl> 89<dt><span class="section"><a href="checked_result.html">checked_result<R></a></span></dt> 90<dt><span class="section"><a href="checked_arithmetic.html">Checked Arithmetic</a></span></dt> 91<dt><span class="section"><a href="interval.html">interval<R></a></span></dt> 92<dt><span class="section"><a href="checked_integer_arithmetic.html">safe_compare<T, U></a></span></dt> 93</dl></dd> 94<dt><span class="section"><a href="performance_tests.html">Performance Tests</a></span></dt> 95<dt><span class="section"><a href="rationale.html">Rationale and FAQ</a></span></dt> 96<dt><span class="section"><a href="pending_issues.html">Pending Issues</a></span></dt> 97<dd><dl> 98<dt><span class="section"><a href="pending_issues.html#idm130201646352"><code class="computeroutput">safe_base</code> Only Works for Scalar Types</a></span></dt> 99<dt><span class="section"><a href="pending_issues.html#idm130201605904">Concepts are Defined but Not Enforced.</a></span></dt> 100<dt><span class="section"><a href="pending_issues.html#idm130201600176">Other Pending Issues</a></span></dt> 101</dl></dd> 102<dt><span class="section"><a href="acknowledgements.html">Acknowledgements</a></span></dt> 103<dt><span class="section"><a href="change_log.html">Release Log</a></span></dt> 104<dt><span class="section"><a href="bibliography.html">Bibliography</a></span></dt> 105</dl> 106</div> 107</div> 108<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 109<td align="left"><p><small>Last revised: $Date</small></p></td> 110<td align="right"><div class="copyright-footer"></div></td> 111</tr></table> 112<hr> 113<div class="spirit-nav"><a accesskey="n" href="introduction.html"><img src="images/next.png" alt="Next"></a></div> 114</body> 115</html> 116