<p dir="auto">This behavior may be misleading since I would consider that <code class="notranslate">2.0e-12</code> means the 0 is significant, which isn't the case with the second command below.</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; sprint(Base.Grisu._show, 2.45e-12, Base.Grisu.PRECISION, 2, true)
&quot;2.4e-12&quot;

julia&gt; sprint(Base.Grisu._show, 2.45e-12, Base.Grisu.PRECISION, 1, true)
&quot;2.0e-12&quot;"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">sprint</span>(Base<span class="pl-k">.</span>Grisu<span class="pl-k">.</span>_show, <span class="pl-c1">2.45e-12</span>, Base<span class="pl-k">.</span>Grisu<span class="pl-k">.</span>PRECISION, <span class="pl-c1">2</span>, <span class="pl-c1">true</span>)
<span class="pl-s"><span class="pl-pds">"</span>2.4e-12<span class="pl-pds">"</span></span>

julia<span class="pl-k">&gt;</span> <span class="pl-c1">sprint</span>(Base<span class="pl-k">.</span>Grisu<span class="pl-k">.</span>_show, <span class="pl-c1">2.45e-12</span>, Base<span class="pl-k">.</span>Grisu<span class="pl-k">.</span>PRECISION, <span class="pl-c1">1</span>, <span class="pl-c1">true</span>)
<span class="pl-s"><span class="pl-pds">"</span>2.0e-12<span class="pl-pds">"</span></span></pre></div>
<p dir="auto">On the other hand, <code class="notranslate">@printf</code> (which uses a different definition for the precision) returns:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="julia&gt; @printf(&quot;%.0e&quot;, 2.45e-12)
2e-12"><pre class="notranslate">julia<span class="pl-k">&gt;</span> <span class="pl-c1">@printf</span>(<span class="pl-s"><span class="pl-pds">"</span>%.0e<span class="pl-pds">"</span></span>, <span class="pl-c1">2.45e-12</span>)
<span class="pl-c1">2e-12</span></pre></div>
<p dir="auto">I guess an argument in favor of Grisu's behavior is that one gets a standard representation where <code class="notranslate">2.0</code> is necessarily a float, i.e. it cannot be mistakenly parsed back as an integer before the parser finds out there's an exponent part. But <code class="notranslate">float("2e-12")</code> works, so that's apparently not a problem.</p>
<p dir="auto">The following code which doesn't seem ambiguous to me gives an ambiguity warning:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type A{T}; end
type B{T}; end

f{T}(::T, ::A{T}) = 1
f{T}(::B{T}, ::T) = 2"><pre class="notranslate">type A{T}; <span class="pl-k">end</span>
type B{T}; <span class="pl-k">end</span>

<span class="pl-en">f</span><span class="pl-c1">{T}</span>(<span class="pl-k">::</span><span class="pl-c1">T</span>, <span class="pl-k">::</span><span class="pl-c1">A{T}</span>) <span class="pl-k">=</span> <span class="pl-c1">1</span>
<span class="pl-en">f</span><span class="pl-c1">{T}</span>(<span class="pl-k">::</span><span class="pl-c1">B{T}</span>, <span class="pl-k">::</span><span class="pl-c1">T</span>) <span class="pl-k">=</span> <span class="pl-c1">2</span></pre></div>