Why I get wrong result with std::pow and std::fmod? : <p>The following lines of code end up returning a wrong result after a calculation, could this be caused by the approximation of the "double" type?</p>

<pre><code>    int base = 20, exp = 27, mod = 123;
    std::fmod(std::pow(base, exp), mod)
</code></pre>

<p>Is there a way to get the right calculation? (also with base = 128, Exp >= 50 mod >= 200?)
Sorry for my bad English </p>
