<p dir="auto">I have just spent quite some time debugging my code because the absolute value function might return negative values. See the following working example:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import numpy as np
np.array([-32768,-3000],dtype=np.dtype('int16'))
np.abs(_)"><pre class="notranslate"><code class="notranslate">import numpy as np
np.array([-32768,-3000],dtype=np.dtype('int16'))
np.abs(_)
</code></pre></div>
<p dir="auto">While the second value is converted to +3000 as expected, the second value is left untouched. I understand that +32768 is out of range for this datatype but I am interested whether returning -32768 is a concious design choice as I was expecting positive values from this function no matter what.</p>
<p dir="auto">There are some functions that fail when passed <code class="notranslate">Decimal</code> objects as scalar inputs. I'm not particularly interested in using Decimal arrays, for obvious reasons, but the lack of scalar support limits our ability (see <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="466129553" data-permission-text="Title is private" data-url="https://github.com/Turbo87/utm/issues/40" data-hovercard-type="issue" data-hovercard-url="/Turbo87/utm/issues/40/hovercard" href="https://github.com/Turbo87/utm/issues/40">Turbo87/utm#40</a>) to use numpy as a 'better' math module in a certain sense. I'm not sure if you would consider this a bug or not. Certainly we can work around it easily, if awkwardly.</p>
<p dir="auto">Relevant for our use cases, this applies to: <em>amax</em>, <em>amin</em>, <em>sin</em>, <em>cos</em>, <em>degrees</em> and <em>radians</em>. The <em>sqrt</em> function seems to already work however.</p>
<p dir="auto">Prior art suggesting that Decimal support is not irrelevant to numpy: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="270785177" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/9952" data-hovercard-type="pull_request" data-hovercard-url="/numpy/numpy/pull/9952/hovercard" href="https://github.com/numpy/numpy/pull/9952">#9952</a></p>
<h3 dir="auto">Reproducing code example:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from decimal import Decimal
import numpy as np
np.sin(Decimal(1))"><pre class="notranslate"><code class="notranslate">from decimal import Decimal
import numpy as np
np.sin(Decimal(1))
</code></pre></div>
<h3 dir="auto">Error message:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="----&gt; 1 np.sin(Decimal(1))

AttributeError: 'decimal.Decimal' object has no attribute 'sin'"><pre class="notranslate"><code class="notranslate">----&gt; 1 np.sin(Decimal(1))

AttributeError: 'decimal.Decimal' object has no attribute 'sin'
</code></pre></div>
<h3 dir="auto">Numpy/Python version information:</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="1.16.4 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0]"><pre class="notranslate"><code class="notranslate">1.16.4 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0]
</code></pre></div>