<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">

<style type="text/css">

body {
  color: #000000;
  background-color: #FFFFFF;
}

del {
  text-decoration: line-through;
  color: #8B0040;
}
ins {
  text-decoration: underline;
  color: #005100;
}

p.example {
  margin: 2em;
}
pre.example {
  margin: 2em;
}
div.example {
  margin: 2em;
}

code.extract {
  background-color: #F5F6A2;
}
pre.extract {
  margin: 2em;
  background-color: #F5F6A2;
  border: 1px solid #E1E28E;
}

p.function {
}

p.attribute {
  text-indent: 3em;
}

blockquote.std {
  color: #000000;
  background-color: #F1F1F1;
  border: 1px solid #D1D1D1;
  padding: 0.5em;
}

blockquote.stddel {
  text-decoration: line-through;
  color: #000000;
  background-color: #FFEBFF;
  border: 1px solid #ECD7EC;
  padding: 0.5em;
}

blockquote.stdins {
  text-decoration: underline;
  color: #000000;
  background-color: #C8FFC8;
  border: 1px solid #B3EBB3;
  padding: 0.5em;
}

table {
  border: 1px solid black;
  border-spacing: 0px;
  border-collapse: collapse;
  margin-left: auto;
  margin-right: auto;
}
th {
  text-align: left;
  vertical-align: top;
  padding: 0.2em;
  border: 1px solid black;
}
td {
  text-align: left;
  vertical-align: top;
  padding: 0.2em;
  border: 1px solid black;
}

</style>


<title>Rounding and Overflow in C++</title>
</head>
<body>
<h1>Rounding and Overflow in C++</h1>

<p>
ISO/IEC JTC1 SC22 WG21 N4448 - 2015-04-12
</p>

<p>
Lawrence Crowl, Lawrence@Crowl.org
</p>


<p>
<a href="#Introduction">Introduction</a><br>
<a href="#References">References</a><br>
</p>


<h2><a name="Introduction">Introduction</a></h2>

<p>
C++ currently provides relatively poor facilities for controlling rounding.
It has even fewer facilities for controlling overflow.
The lack of such facilities often leads programmers to ignore the issue, 
making software less robust than it could be (and should be).
</p>

<p>
This paper presents the issues
and provides some candidate enumerations and operations.
The intent of the paper is to gather feedback on
support for and direction of future work.
</p>


<h2><a name="Rounding">Rounding</a></h2>

<p>
Rounding is necessary whenever
the resolution of a variable
is coarser than the resolution of a value to be placed in that variable.
</p>


<h3><a name="RoundStatus">Current Status</a></h3>

<p>
The <code>numeric_limits</code> field <code>round_style</code>
provides information on the style of rounding employed by a type.
</p>

<pre>
<code>namespace std {</code>
<code>  enum float_round_style {</code>
<code>    round_indeterminate = -1, //</code> indeterminable
<code>    round_toward_zero = 0, //</code> toward zero
<code>    round_to_nearest = 1, //</code> to the nearest representable value
<code>    round_toward_infinity = 2, //</code> toward [positive] infinity
<code>    round_toward_neg_infinity = 3 //</code> toward negative infinity
<code>  };</code>
<code>}</code>
</pre>

<p>
This specification is incomplete
in that it fails to specify what happens when
the value is equally far from the two nearest representable values.
</p>

<p>
The standard also says
"Specializations for integer types
shall return <code>round_toward_zero</code>."
This requirement is somewhat misleading as
a right-shift operation on a two's complement representation
does not round toward zero.
</p>

<p>
Headers <code>&lt;cfenv&gt;</code> and <code>&lt;fenv.h&gt;</code>
provide functions for setting and getting
the floating-point rounding mode,
<code>fesetround</code> and <code>fegetround</code>, respectively.
The mode is specified via a macro constant:
</p>

<table>
<thead>
<tr><th>Constant</th>
    <th>Explanation</th></tr>
</thead>
<tbody>
<tr><td><code>FE_DOWNWARD</code></td>
    <td>rounding towards negative infinity</td></tr>
<tr><td><code>FE_TONEAREST</code></td>
    <td>rounding towards nearest integer</td></tr>
<tr><td><code>FE_TOWARDZERO</code></td>
    <td>rounding towards zero</td></tr>
<tr><td><code>FE_UPWARD</code></td>
    <td>rounding towards positive infinity </td></tr>
</tbody>
</table>

<p>
Again, the specification
is incomplete with respect to <code>FE_TONEAREST</code>
</p>

<h3><a name="RoundBase">Base Requirements</a></h3>

<p>
The base requirements on a <var>round</var> function are:
<ul>
<li>
<p>
Given a value <var>x</var>
and two adjacent representable values <var>y</var>&nbsp;&lt;&nbsp;<var>z</var>
such that <var>y</var>&nbsp;&le;&nbsp;<var>x</var>&nbsp;&le;&nbsp;<var>z</var>
then
</p>
<ul>
<li><p>if <var>x</var>&nbsp;=&nbsp;<var>y</var>
then <var>round</var>(<var>x</var>)&nbsp;=&nbsp;<var>y</var>,</p></li>
<li><p>if <var>x</var>&nbsp;=&nbsp;<var>z</var>
then <var>round</var>(<var>x</var>)&nbsp;=&nbsp;<var>z</var>,</p></li>
<li><p>and otherwise <var>round</var>(<var>x</var>)&nbsp;=&nbsp;<var>y</var>
or <var>round</var>(<var>x</var>)&nbsp;=&nbsp;<var>z</var>.</p></li>
</ul>
</li>
<li>
<p>
Given an additional value <var>w</var>
such that <var>y</var>&nbsp;&le;&nbsp;<var>w</var>&nbsp;&le;&nbsp;<var>x</var>&nbsp;&le;&nbsp;<var>z</var>
then
</p>
<ul>
<li><p>
<var>y</var>&nbsp;&le;&nbsp;<var>round</var>(<var>w</var>)&nbsp;&le;&nbsp;<var>round</var>(<var>x</var>)&nbsp;&le;&nbsp;<var>z</var>
</p></li>
</ul>
</ul>


<h3><a name="RoundMode">Modes</a></h3>

<p>
The number of rounding modes is perhaps unlimited.
However, we can explore the space of reasonably efficient rounding modes
with two notions, its direction and its domain.
</p>

<p>
There are six precisely-defined rounding directions
and at least three additional practical directions.
They are:
</p>

<table>
<tr><td>towards negative infinity</td>
    <td>towards positive infinity</td></tr>
<tr><td>towards zero</td>
    <td>away from zero</td></tr>
<tr><td>towards even</td>
    <td>towards odd</td></tr>
<tr><td>fastest execution time</td>
    <td>smallest generated code</td></tr>
<tr><td colspan=2>whatever, I'm not picky</td></tr>
</table>

<p>
Of these directions,
only towards even and towards odd are unbiased.
</p>

<p>
Rounding towards odd has two desirable properties.
First, the direction will not induce a carry out of the units position.
This property avoids overflow and increased representation size.
Second, because most operations
tend to preserve zeros in the lowest bit,
the towards-even direction carries less information than towards-odd.
This effect increases as the number of bits decreases.
However, rounding towards even produces numbers
that are "nicer" than those produced by rounding towards odd.
For example, you are more likely to get 10 than 9.9999999
with rounding towards even.
</p>

<p>
There are at least two direction domains:
</p>

<ul>
<li><p>
All values between two representable values move in the given direction.
</p></li>
<li><p>
Only values midway between two representable values move in the given direction.
Other values move to the nearest representable value.
That is, the direction is a tie breaker.
</p></li>
</ul>

<p>
Several of the precise rounding modes are in current use.
</p>

<table>
<thead>
<tr><th>direction</th><th colspan=2>domain</th></tr>
<tr><th></th><th>all</th><th>tie</th></tr>
</thead>
<tbody>
<tr><td>towards negative infinity</td>
    <td>interval arithmetic lower bound<br>
        two's complement right shift</td>
    <td></td></tr>
<tr><td>towards positive infinity</td>
    <td>interval arithmetic upper bound</td>
    <td></td></tr>
<tr><td>towards zero</td>
    <td>C/C++ integer division<br>
        signed-magnitude right shift</td>
    <td></td></tr>
<tr><td>away from zero</td>
    <td></td>
    <td>schoolbook rounding<br>
        the <code>&lt;cmath&gt;</code> <code>round</code> functions</td></tr>
<tr><td>towards nearest even</td>
    <td></td>
    <td>IEEE floating-point default</td></tr>
<tr><td>towards nearest odd</td>
    <td></td>
    <td>some accounting rules</td></tr>
</tbody>
</table>

<p>
We represent the mode in C++ as an enumeration:
</p>

<pre>
<code>enum class rounding {
  all_to_neg_inf, all_to_pos_inf,
  all_to_zero, all_away_zero,
  all_to_even, all_to_odd,
  all_fastest, all_smallest,
  all_unspecified,
  tie_to_neg_inf, tie_to_pos_inf,
  tie_to_zero, tie_away_zero,
  tie_to_even, tie_to_odd,
  tie_fastest, tie_smallest,
  tie_unspecified
};</code>
</pre>

<p>
Some of these modes may not be needed.
</p>


<h3><a name="RoundFunctions">Functions</a></h3>

<p>
Within the definition of the following functions,
we use a defining function,
which we do not expect will
be directly represented in C++.
It is <var>T&nbsp;round</var>(<var>mode</var>,<var>U</var>)
where <var>U</var> either
</p>

<ul>
<li><p>
has a finer resolution than <var>T</var> or
</p></li>
<li><p>
is evaluated as a real number expression.
</p></li>
</ul>

<p>
We already have rounding functions for converting
floating-point numbers to integers.
However, the facility extends to different sizes of floating-point
and between other numeric types.
</p>

<dl>
<dt><code>template&lt;rounding mode, typename T, typename U&gt;
T convert(U value)</code></dt>
<dd><p>
The result is <var>round</var><code>(mode,&nbsp;U)</code>.
</p></dd>
</dl>

<p>
A division function has obvious utility.
</p>

<dl>
<dt><code>template&lt;rounding mode, typename T&gt;
T divide(T dividend, T divisor)</code></dt>
<dd><p>
The result is <var>round</var><code>(mode,dividend</code>/<code>divisor)</code>.
Remember that division is evaluates as a real number.
Obviously, the implementation will use a different strategy,
but it must yield the same result.
</p></dd>
</dl>

<p>
Division by a power of two has substantial implementation efficiencies,
and is used heavily in fixed-point arithmetic as a scaling mechanism.
We represent the conjunction of these approaches with a rounding right shift.
</p>

<dl>
<dt><code>template&lt;rounding mode, typename T&gt;
T rshift(T value, int bits)</code></dt>
<dd><p>
The result is <var>round</var><code>(mode,dividend</code>/2<sup><code>bits</code></sup><code>)</code>.
</p></dd>
</dl>

<p>
We can add other functions as needed.
</p>


<h2><a name="Overflow">Overflow</a></h2>

<p>
Overflow is possible whenever
the range of an expression
exceeds the range of a variable.
</p>

<h3><a name="OverStatus">Current Status</a></h3>

<p>
Signed integer overflow is undefined behavior.
Programmers attempting to detect and handle overflow often get it wrong, 
in that they end up using overflow to detect overflow.
Suffice it to say that present solutions are inadequate.
</p>

<p>
Unsigned integer overflow is defined to be mod 2<sup>bits-in-type</sup>.
While this definition is exactly right when
coding in modular arithmetic,
it is counter-productive
when one is using unsigned arithmetic
to state that the value is non-negative.
In the latter environment,
undefined behavior on overflow is better,
as it enables tools to detect problems.
</p>

<p>
Floating-point overflow can be detected and altered
via
<code>fegetexceptflag</code>,
<code>fesetexceptflag</code>,
<code>feclearexcept</code>, and
<code>feraiseexcept</code>
with the value <code>FE_OVERFLOW</code>.
However, such checking requires additional out-of-band effort.
That is, any checking takes place
in code separate from the operations themselves.
</p>

<h3><a name="OverBaseReq">Base Requirements</a></h3>

<p>
The base requirements on a <var>overflow</var> function are:
</p>
<ul>
<li>
<p>
Given a value <var>x</var> and a representable range
<var>y</var>&nbsp;&le;&nbsp;<var>z</var>
such that <var>y</var>&nbsp;&le;&nbsp;<var>x</var>&nbsp;&le;&nbsp;<var>z</var>
then an overflow does not occur and
<ul>
<li><p>
<var>overflow</var>(<var>x</var>)&nbsp;=&nbsp;<var>x</var>.
</p></li>
</ul>
</li>
<li>
<p>
Otherwise, an overflow has occured and
the function may, for all overflow values, choose either:
</p>
<ul>
<li><p>
Consider the expression an error,
handling it or not as appropriate.
</p></li>
<li><p>
Return a normal value
<var>w</var>&nbsp;=&nbsp;<var>overflow</var>(<var>x</var>)
such that
<var>y</var>&nbsp;&le;&nbsp;<var>w</var>&nbsp;&le;&nbsp;<var>z</var>.
</p></li>
<li><p>
Return a special value indicating overflow, e.g. IEEE infinities.
This choice implies defining the result of operations
given this special value as an argument.
</p></li>
</ul>
</li>
</ul>


<h3><a name="OverMode">Modes</a></h3>

<p>
Several overflow modes are possible.
We categorize them based on the choices in the base requirements.
Other modes may be possible or desirable as well.
</p>

<p>
Some error modes are as follows.
</p>

<blockquote>
<dl>

<dt>impossible</dt>
<dd><p>
Mathematically, overflow cannot occur.
This mode is useful when an overflow specification is necessary,
but compiler-based range propogation is insufficient to eliminating a check.
The mode is an assertion on the part of the programmer.
It invites reviewers to examine the accompanying proof.
Ignoring overflow and letting the program stray into
undefined behavior is a suitable implementation.
</p></dd>

<dt>undefined</dt>
<dd><p>
The programmer states that overflow is sufficiently
rare so that overflow is not a concern.
Aborting on overflow is a suitable implementation.
So is ignoring the issue and letting the program
stray into undefined behavior.
</p></dd>

<dt>abort</dt>
<dd><p>
Abort the program on overflow.
Detection is required.
</p></dd>

<dt>exception</dt>
<dd><p>
Throw an exception on overflow.
Detection is required.
</p></dd>

</dl>
</blockquote>

<p>
A special substitution mode is as follows.
Detection is required.
</p>

<blockquote>
<dl>

<dt>special</dt>
<dd><p>
Return one of possibly several special values indicating overflow.
</p></dd>

</dl>
</blockquote>

<p>
Some normal substitution modes are as follows.
Detection is required.
</p>

<blockquote>
<dl>

<dt>saturate</dt>
<dd><p>
Return the nearest value within the valid range.
</p></dd>

<dt>modulo with shifted scale</dt>
<dd><p>
For unsigned arguments and range from 0 to <var>z</var>,
the result is simply <var>x</var>&nbsp;mod&nbsp;(<var>z</var>+1).
Shifting the range such that
0&nbsp;&lt;&nbsp;<var>y</var>&nbsp;&le;&nbsp;<var>z</var>
requires a more complicated expression,
<var>y</var>&nbsp;+&nbsp;((<var>x</var>&ndash;<var>y</var>) mod (<var>z</var>&ndash;<var>y</var>+1)).
We can also use this expression when
<var>y</var>&nbsp;&lt;&nbsp;0.
That is, it is a general purpose definition.
However, it may not yield results consistent with division.
</p></dd>

<dt>modulo with sign from divided</dt>
<dd><p>
With <var>y</var>&nbsp;=&nbsp;&ndash;<var>z</var>,
the expression
<var>x</var>&ndash;(<var>z</var>+1)&times;trunc(<var>x</var>/(<var>z</var>+1))
produces values consistent with truncated division,
i.e. normal C/C++ division.
For unbalanced ranges, e.g. the range of two's-complement representation,
the situation is more complicated.
A significant property of this approach
is that the sign of the remainder matches the sign of the dividend,
enabling a strategy of using to different methods
depending on the sign of the value.
On can either use the smallest bound as the divisor,
or use the bound corresponding to the sign of the dividend.
The former fails to cycle through all elements of the range.
The later produces different periods depending on sign.
The situtation is yet more complicated when the range does not span zero.
</p></dd>

<dt>modulo with sign from divisor</dt>
<dd><p>
With <var>y</var>&nbsp;=&nbsp;&ndash;<var>z</var>,
the expression
<var>x</var>&ndash;(<var>z</var>+1)&times;floor(<var>x</var>/(<var>z</var>+1))
produces values consistent with floored division.
Given that <var>z</var> is positive,
all results are non-negative, using only half the range.
Many of the same issues arise here as well.
</p></dd>

<dt>modulo with positive sign</dt>
<dd><p>
With <var>y</var>&nbsp;&le;&nbsp;0&nbsp;&lt;&nbsp;<var>z</var>,
the expression
<var>x</var>&ndash;(<var>z</var>+1)&times;sgn(<var>z</var>+1)&times;floor(<var>x</var>/abs(<var>z</var>+1))
produces values consistent with Euclidean division,
All results are non-negative, using only half the range.
Many of the same issues arise here as well.
</p></dd>

</dl>
</blockquote>

<p>
Various overflow modes are in current use.
</p>

<table>
<tr><th>mode</th>
    <th>uses</th></tr>
<tr><td>impossible</td>
    <td>well-analyzed programs</td></tr>
<tr><td>undefined</td>
    <td>C/C++ signed integers<br>
    C (TR 18037) unsaturated fixed-point types<br>
    most programs</td></tr>
<tr><td>abort</td>
    <td></td></tr>
<tr><td>exception</td>
    <td>Ada integers<br>
    C# integers in checked context</td></tr>
<tr><td>special</td>
    <td>IEEE floating-point</td></tr>
<tr><td>saturate</td>
    <td>C (TR 18037) unsaturated fixed-point types<br>
    digital signal processing hardware</td></tr>
<tr><td>modulo with shifted scale</td>
    <td>two's-complement wrap-around<br>
    C/C++ unsigned integers<br>
    C# integers in unchecked context<br>
    Java signed integers</td></tr>
<tr><td>modulo with sign from dividend</td>
    <td></td></tr>
<tr><td>modulo with sign from divisor</td>
    <td></td></tr>
<tr><td>modulo with positive sign</td>
    <td></td></tr>
</table>

<p>

<p>
We represent the mode in C++ as an enumeration:
</p>

<pre>
<code>enum class overflow {
  impossible, undefined, abort, exception,
  special,
  saturate, modulo_shifted, modulo_dividend, modulo_divisor, modulo_positive
};</code>
</pre>

<h3><a name="OverFunctions">Functions</a></h3>


<p>
Within the definition of the following functions,
we use a defining function,
which we do not expect will
be directly represented in C++.
It is
<var>T&nbsp;overflow</var>(<var>mode</var>,<var>T&nbsp;lower</var>,<var>T&nbsp;upper</var>,<var>U&nbsp;value</var>)
where <var>U</var> either
</p>
<ul>
<li><p>
has a wider range than <var>T</var> or
</p></li>
<li><p>
is evaluated as a real number expression.
</p></li>
</ul>

<p>
Many C++ conversions already reduce the range of a value,
but they do not provide programmer control of that reduction.
We can give programmers control.
</p>

<dl>
<dt><code>template&lt;overflow mode, typename T, typename U&gt;
T convert(U value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
numeric_limits&lt;T&gt;::min,
numeric_limits&lt;T&gt;::max,
value)</code>.
</p></dd>
</dl>

<p>
Being able to specify overflow between variables of the same type
is also helpful.
</p>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T limit(T lower, T upper, T value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
lower,
upper,
value)</code>.
</p></dd>
</dl>

<p>
Common arguments can be elided with convenience functions.
</p>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T limit_positive(T upper, T value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
0,
upper,
value)</code>.
</p></dd>
</dl>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T limit_signed(T upper, T value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
-upper,
upper,
value)</code>.
</p></dd>
</dl>

<p>
Two's-complement numbers are a slight variant on the above.
</p>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T limit_twoscomp(T upper, T value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
-upper-1,
upper,
value)</code>.
</p></dd>
</dl>

<p>
For binary representations, we can also specify bits instead.
While this specification may seem redundant,
it enables faster implementations.
</p>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T limit_positive_bits(T upper, T value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
0,
</code>2<sup><code>upper</code></sup><code>-1,
value)</code>.
</p></dd>
</dl>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T limit_signed_bits(T upper, T value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
-(</code>2<sup><code>upper</code></sup><code>-1),
</code>2<sup><code>upper</code></sup><code>-1,
value)</code>.
</p></dd>
</dl>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T limit_twoscomp_bits(T upper, T value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
-</code>2<sup><code>upper</code></sup><code>,
</code>2<sup><code>upper</code></sup><code>-1,
value)</code>.
</p></dd>
</dl>

<p>
Embedding overflow detection within regular operations
can lead to enhanced performance.
In particular, left shift is a important candidate operation
within fixed-point arithmetic.
</p>

<dl>
<dt><code>template&lt;overflow mode, typename T&gt;
T lshift(T value, int count)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(mode,
numeric_limits&lt;T&gt;::min,
numeric_limits&lt;T&gt;::max,
value</code>&times;2<sup><code>count</code></sup><code>)</code>.
</p></dd>
</dl>

<p>
As before, finer specification of the limits is reasonable.
</p>

<p>
We can add other functions as needed.
</p>

<h2><a name="Both">Both Rounding and Overflow</a></h2>

<p>
Some operations may reasonably
both require rounding and require overflow detection.
</p>

<p>
First and foremost,
conversion from floating-point to integer
may require handling a floating-point value
that has both a finer resolution
and a larger range
than the integer can handle.
The problem generalizes to arbitrary numeric types.
</p>

<dl>
<dt><code>template&lt;overflow omode, rounding rmode, typename T, typename U&gt;
T convert(U value)</code></dt>
<dd><p>
The result is
<var>overflow</var><code>(omode,
numeric_limits&lt;T&gt;::min,
numeric_limits&lt;T&gt;::max,</code>
<var>round</var><code>(rmode,value))</code>.
</p></dd>
</dl>

<p>
Consider shifting as multiplication by a power of two.
It has an analogy in a <em>bidirectional</em> shift,
where a positive power is a left shift and a negative power is a right shift.
</p>

<dl>
<dt><code>template&lt;overflow omode, rounding rmode, typename T&gt;
T bshift(T value, int count)</code></dt>
<dd><p>
The result is
<code>count</code>&nbsp;&lt;&nbsp;0<br>
?&nbsp;<var>round</var><code>(rmode,value</code>&times;2<sup><code>count</code></sup><code>)</code><br>
:&nbsp;<var>overflow</var><code>(omode,
numeric_limits&lt;T&gt;::min,
numeric_limits&lt;T&gt;::max,
value</code>&times;2<sup><code>count</code></sup><code>)</code>.
</p></dd>
</dl>

<h2><a name="Parameter">Template Parameter versus Function Parameter</a></h2>

<p>
The above functions pass the modes as template arguments.
This approach seems to be the primary use case.
It also permits incremental development
of both modes and the types they apply to.
Furthermore,
it also permits not specifying combinations
of mode and type that make no sense.
In the event that dynamic dispatch is needed,
a dispatch function is not a significant task.
</p>

<p>
The problem with using template parameters
is that the functions need to be partially specialized.
They cannot be overloaded
because the mode does not appear in the function signature.
Unfortunately, there is no direct support
for function template partial specialization.
Working around this problem
requires defining an artificial class
to attach the partial specialization.
This will increase the complexity of specification.
</p>

</body>
</html>
