<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content=
"HTML Tidy for OS/2 (vers 1 September 2005), see www.w3.org">
<style type="text/css">
del { font-weight:bold;background-color:#ffa0a0 }
ins { font-weight:bold;background-color:#a0ffa0 }
blockquote {
display: block;
font-family: "Times New Roman";
background-color:lightgray;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 40px;
margin-right: 40px
}
</style>
<title>Nxxxx: Range errors and math functions</title>
</head>
<body>
<p><br>
<!-- Who are the authors... -->
<b>Submitter:</b>Fred Tydeman<br>
<!-- What is the date of submission. yyyy-mm-dd -->
<b>Submission Date:</b> 2019-10-??<br>
<b>Document:</b> WG14 Nxxxx<br>
<b>Reference Documents:</b></p>
<p>Summary</p>
<p>The standard has a few incorrect, missing, or ambiguous
statements about range errors in some of the math functions.</p>
<p>Does "too large" mean close to +infinity or +/-infinity?</p>
<p>Does "too small" mean close to -infinity or +/-zero?</p>
<p>Some implementations incorrectly treat f(infinity) as a range
error based upon the text: A range error occurs if [the magnitude
of] x is too large. While this is covered by 7.12.1#5 about
overflows, the CFP group believes it is better to be explicit in
each math function where it matters.</p>
<p>Possible Technical Corrigendum:</p>
<ul>
<li>The asin functions
<p>Add to 7.12.4.2#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The atan functions
<p>Add to 7.12.4.3#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The atan2 functions
<p>Add to 7.12.4.4#2</p>
<blockquote>
<ins>A range error occurs if x is positive and y/x is too
close to zero.</ins>
</blockquote>
</li>
<li>The sin functions
<p>Add to 7.12.4.6#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The tan functions
<p>Add to 7.12.4.7#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The sinpi functions
<p>Add to 7.12.4.13#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The tanpi functions
<p>Add to 7.12.4.14#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The asinh functions
<p>Add to 7.12.5.2#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The atanh functions
<p>Add to 7.12.5.3#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The cosh functions
<p>Change 7.12.5.4#2 from</p>
<blockquote>
A range error occurs if the magnitude of x is too large.
</blockquote>
<p>to</p>
<blockquote>
A range error occurs if the magnitude of <ins>finite</ins>
x is too large.
</blockquote>
</li>
<li>The sinh functions
<p>Change 7.12.5.5#2 from</p>
<blockquote>
A range error occurs if the magnitude of x is too large.
</blockquote>
<p>to</p>
<blockquote>
A range error occurs if the magnitude of <ins>finite</ins>
x is too large <ins>or if x is too close to zero</ins>.
</blockquote>
</li>
<li>The tanh functions
<p>Add to 7.12.5.6#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The exp functions
<p>Change 7.12.6.1#2 from</p>
<blockquote>
A range error occurs if the magnitude of x is too large.
</blockquote>
<p>to</p>
<blockquote>
A range error occurs if the magnitude of <ins>finite</ins>
x is too large.
</blockquote>
</li>
<li>The exp10m1 functions
<p>Change 7.12.6.3#2 from</p>
<blockquote>
A range error occurs if finite x is too large or if the
magnitude of nonzero x is too small.
</blockquote>
<p>to</p>
<blockquote>
A range error occurs if <ins>positive</ins> finite x is too
large or if <del>the magnitude of nonzero</del> x is too
<del>small</del><ins>close to zero</ins>.
</blockquote>
</li>
<li>The exp2 functions
<p>Change 7.12.6.4#2 from</p>
<blockquote>
A range error occurs if the magnitude of x is too large.
</blockquote>
<p>to</p>
<blockquote>
A range error occurs if the magnitude of <ins>finite</ins>
x is too large.
</blockquote>
</li>
<li>The exp2m1 functions
<p>Change 7.12.6.5#2 from</p>
<blockquote>
A range error occurs if the magnitude of x is too large or
if the magnitude of nonzero x is too small.
</blockquote>
<p>to</p>
<blockquote>
A range error occurs if <del>the magnitude of</del>
<ins>positive finite</ins> x is too large or if <del>the
magnitude of nonzero</del> x is too
<del>small</del><ins>close to zero</ins>.
</blockquote>
</li>
<li>The expm1 functions
<p>Change 7.12.6.6#2 from</p>
<blockquote>
A range error occurs if positive x is too large.252)
</blockquote>
<p>to</p>
<blockquote>
A range error occurs if positive <ins>finite</ins> x is too
large <ins>or if x is too close to zero</ins>.252)
</blockquote>
</li>
<li>The ldexp functions
<p>Change 7.12.6.9#2 from</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur <ins>for finite x</ins>.
</blockquote>
</li>
<li>The log1p and logp1 functions
<p>Add to 7.12.6.14#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The log2p1 functions
<p>Add to 7.12.6.16#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The scalbn and scalbln functions
<p>Change 7.12.6.19#2 from</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur <ins>for finite x</ins>.
</blockquote>
</li>
<li>The compoundn functions
<p>Change 7.12.7.2#2 from</p>
<blockquote>
A range error may occur if n is too large, depending on x.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur if <ins>the magnitude of</ins> n is
too large, depending on <ins>finite</ins> x.
</blockquote>
</li>
<li>The hypot functions
<p>Change 7.12.7.4#2 from</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur <ins>for finite arguments</ins>.
</blockquote>
</li>
<li>The pow functions
<p>Change 7.12.7.5#2 from</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur <ins>for finite x</ins>.
</blockquote>
</li>
<li>The pown functions
<p>Change 7.12.7.6#2 from</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur <ins>for finite x</ins>.
</blockquote>
</li>
<li>The powr functions
<p>Change 7.12.7.7#2 from</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur <ins>for finite x</ins>.
</blockquote>
</li>
<li>The rootn functions
<p>Change 7.12.7.8#2 from</p>
<blockquote>
A range error may occur if n is -1.
</blockquote>
<p>to</p>
<blockquote>
A range error may occur <ins>for finite x</ins> if n is -1.
</blockquote>
</li>
<li>The erf functions
<p>Add to 7.12.8.1#2</p>
<blockquote>
<ins>A range error occurs if x is too close to zero.</ins>
</blockquote>
</li>
<li>The erfc functions
<p>Change 7.12.8.2#2</p>
<blockquote>
A range error occurs if positive x is too large.
</blockquote>
<p>to:</p>
<blockquote>
A range error occurs if positive <ins>finite</ins> x is too
large.
</blockquote>
</li>
<li>The lgamma functions
<p>Change 7.12.8.3#2</p>
<blockquote>
A range error occurs if positive x is too large.
</blockquote>
<p>to:</p>
<blockquote>
A range error occurs if positive <ins>finite</ins> x is too
large.
</blockquote>
</li>
<li>The tgamma functions
<p>Change 7.12.8.4#2</p>
<blockquote>
A range error occurs if the magnitude of x is too large and
may occur if the magnitude of x is too small.
</blockquote>
<p>to:</p>
<blockquote>
A range error occurs <ins>for some negative finite x
or</ins> if <del>the magnitude of</del><ins>positive
finite</ins> x is too large<ins>;</ins> and may occur if
<del>the magnitude of</del> x is too
<del>small</del><ins>close to zero</ins>.
</blockquote>
</li>
<li>The fmod functions
<p>Add to 7.12.10.1#2</p>
<blockquote>
<ins>A range error may occur if both x and y are nonzero
and either is too close to zero.</ins>
</blockquote>
</li>
<li>The remainder functions
<p>Add to 7.12.10.2#2</p>
<blockquote>
<ins>A range error may occur if both x and y are nonzero
and either is too close to zero.</ins>
</blockquote>
</li>
<li>The fdim functions
<p>Change 7.12.12.1#2</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to:</p>
<blockquote>
A range error may occur <ins>for finite arguments</ins>.
</blockquote>
</li>
<li>The fma functions
<p>Change 7.12.13.1#2</p>
<blockquote>
A range error may occur.
</blockquote>
<p>to:</p>
<blockquote>
A range error may occur <ins>for finite arguments</ins>.
</blockquote>
</li>
</ul>
</body>
</html>