<p dir="auto">For most floating point types, <code class="notranslate">nextfloat(x, n)</code> and <code class="notranslate">prevfloat(x, n)</code> are defined to be the nth next or nth previous floating point value.  BigFloats support neither.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; p1 = Dates.Second(2) + (Dates.Millisecond(7) + Dates.Millisecond(1))
2 seconds, 8 milliseconds

julia&gt; p2 = (Dates.Second(2) + Dates.Millisecond(7)) + Dates.Millisecond(1)
2 seconds, 7 milliseconds, 1 millisecond

julia&gt; p2 == p1
false"><pre class="notranslate"><code class="notranslate">julia&gt; p1 = Dates.Second(2) + (Dates.Millisecond(7) + Dates.Millisecond(1))
2 seconds, 8 milliseconds

julia&gt; p2 = (Dates.Second(2) + Dates.Millisecond(7)) + Dates.Millisecond(1)
2 seconds, 7 milliseconds, 1 millisecond

julia&gt; p2 == p1
false
</code></pre></div>
<p dir="auto">Seems like the problem could be fixed by making the <code class="notranslate">CompoundPeriod</code> constructor canonicalize its contents by combining periods of the same type.</p>