<p dir="auto">People have asked for expm on a number of occasions. The following implementation contributed for scilab can serve as a guide for the julia implementation.</p>
<p dir="auto"><a href="http://www.scilab.org/contrib/index_contrib.php?page=displayContribution&amp;fileID=1231" rel="nofollow">http://www.scilab.org/contrib/index_contrib.php?page=displayContribution&amp;fileID=1231</a><br>
<a href="http://www.scilab.org/contrib/download.php?fileID=1231&amp;attachFileName=expm.sci" rel="nofollow">http://www.scilab.org/contrib/download.php?fileID=1231&amp;attachFileName=expm.sci</a></p>
<p dir="auto">It is likely that we will run into some un-implemented linear algebra functions, but that should just help completeness.</p>
<p dir="auto">The following behaviors have been causing bugs in some code of mine:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="searchsortedlast([0.0, 1.0], +0.0)  # returns 1
searchsortedlast([0.0, 1.0], -0.0)  # returns 0

searchsorted([0.0], +0.0)  # returns 1:1
searchsorted([0.0], -0.0)  # returns 1:0

searchsorted([0.0], 0.0; lt=&lt;=)  # returns 2:1"><pre class="notranslate"><span class="pl-c1">searchsortedlast</span>([<span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>], <span class="pl-k">+</span><span class="pl-c1">0.0</span>)  <span class="pl-c"><span class="pl-c">#</span> returns 1</span>
<span class="pl-c1">searchsortedlast</span>([<span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>], <span class="pl-k">-</span><span class="pl-c1">0.0</span>)  <span class="pl-c"><span class="pl-c">#</span> returns 0</span>

<span class="pl-c1">searchsorted</span>([<span class="pl-c1">0.0</span>], <span class="pl-k">+</span><span class="pl-c1">0.0</span>)  <span class="pl-c"><span class="pl-c">#</span> returns 1:1</span>
<span class="pl-c1">searchsorted</span>([<span class="pl-c1">0.0</span>], <span class="pl-k">-</span><span class="pl-c1">0.0</span>)  <span class="pl-c"><span class="pl-c">#</span> returns 1:0</span>

<span class="pl-c1">searchsorted</span>([<span class="pl-c1">0.0</span>], <span class="pl-c1">0.0</span>; lt<span class="pl-k">=</span><span class="pl-k">&lt;=</span>)  <span class="pl-c"><span class="pl-c">#</span> returns 2:1</span></pre></div>
<p dir="auto">In all cases I encountered, I could get away with it by using <code class="notranslate">searchsortedXXXX(args... ; lt=&lt;)</code>.</p>
<p dir="auto">However, assuming the above behavior is what's intended, I believe there's an inconsistency in the docs.<br>
For instance, for <code class="notranslate">searchsorted</code>:</p>
<blockquote>
<p dir="auto">searchsorted(a, x; by=&lt;transform&gt;, lt=&lt;comparison&gt;, rev=false)</p>
<p dir="auto">Return the range of indices of a which compare as equal to x (using binary search) according to<br>
the order specified by the by, lt and rev keywords, assuming that a is already sorted in that order.<br>
Return an empty range located at the insertion point if a does not contain values equal to x.</p>
</blockquote>
<p dir="auto">It's hard to believe that <code class="notranslate">[0.0]</code> does not contain any value equal to <code class="notranslate">0.0</code> <g-emoji class="g-emoji" alias="sweat_smile" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f605.png">😅</g-emoji></p>
<p dir="auto">If it's a bug, I probably can't fix it, but if it's intended and clarifying the docs would be satisfactory, then I'm happy to do so.</p>