<p dir="auto"><code class="notranslate">A_mul_B!(B, A, B)</code> replaces B with all zeros for the case where A is not small and square:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="X = randn(3, 2)
Y = randn(3, 3)
Z = randn(3, 4)

M = randn(3, 3)
R = expm(M - M')

display(A_mul_B!(X, R, X))
display(A_mul_B!(Y, R, Y))
display(A_mul_B!(Z, R, Z))"><pre class="notranslate">X <span class="pl-k">=</span> <span class="pl-c1">randn</span>(<span class="pl-c1">3</span>, <span class="pl-c1">2</span>)
Y <span class="pl-k">=</span> <span class="pl-c1">randn</span>(<span class="pl-c1">3</span>, <span class="pl-c1">3</span>)
Z <span class="pl-k">=</span> <span class="pl-c1">randn</span>(<span class="pl-c1">3</span>, <span class="pl-c1">4</span>)

M <span class="pl-k">=</span> <span class="pl-c1">randn</span>(<span class="pl-c1">3</span>, <span class="pl-c1">3</span>)
R <span class="pl-k">=</span> <span class="pl-c1">expm</span>(M <span class="pl-k">-</span> M<span class="pl-k">'</span>)

<span class="pl-c1">display</span>(<span class="pl-c1">A_mul_B!</span>(X, R, X))
<span class="pl-c1">display</span>(<span class="pl-c1">A_mul_B!</span>(Y, R, Y))
<span class="pl-c1">display</span>(<span class="pl-c1">A_mul_B!</span>(Z, R, Z))</pre></div>
<p dir="auto">outputs:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="3x2 Array{Float64,2}:
 0.0  0.0
 0.0  0.0
 0.0  0.0

3x3 Array{Float64,2}:
 1.6548     0.742438  -1.50673
 0.282773  -1.35856   -0.39896
 0.700949  -1.27408   -0.846028

3x4 Array{Float64,2}:
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0"><pre class="notranslate"><code class="notranslate">3x2 Array{Float64,2}:
 0.0  0.0
 0.0  0.0
 0.0  0.0

3x3 Array{Float64,2}:
 1.6548     0.742438  -1.50673
 0.282773  -1.35856   -0.39896
 0.700949  -1.27408   -0.846028

3x4 Array{Float64,2}:
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0
</code></pre></div>
<p dir="auto">Here's my version info:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Julia Version 0.4.0
Commit 0ff703b* (2015-10-08 06:20 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3"><pre class="notranslate"><code class="notranslate">Julia Version 0.4.0
Commit 0ff703b* (2015-10-08 06:20 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-3615QM CPU @ 2.30GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
</code></pre></div>
<p dir="auto">It seems there is a bug in A_mul_B! when both matrices have dimension (1, 1)</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a = fill(1.0, (1,1)) ;  b = fill(1.0, (1,1)) ; A_mul_B!(a, a, b)
#&gt; 1x1 Array{Float64,2}:
#&gt; 0.0"><pre class="notranslate">a <span class="pl-k">=</span> <span class="pl-c1">fill</span>(<span class="pl-c1">1.0</span>, (<span class="pl-c1">1</span>,<span class="pl-c1">1</span>)) ;  b <span class="pl-k">=</span> <span class="pl-c1">fill</span>(<span class="pl-c1">1.0</span>, (<span class="pl-c1">1</span>,<span class="pl-c1">1</span>)) ; <span class="pl-c1">A_mul_B!</span>(a, a, b)
<span class="pl-c"><span class="pl-c">#</span>&gt; 1x1 Array{Float64,2}:</span>
<span class="pl-c"><span class="pl-c">#</span>&gt; 0.0</span></pre></div>
<p dir="auto">I expected the results to return 1 but it returns 0. This happens both in 0.3.9 and 0.4.0-dev+5446</p>