On Wed, Jun 1, 2011 at 9:06 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote"><div class="im">On Wed, Jun 1, 2011 at 14:51, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Isn't it casting to PowInt which is int?</blockquote><div><br></div></div><div>Not exactly. If I define</div><div><br></div><div>  #define PetscPowScalar(a, b) std::pow(a, (int) b)</div></blockquote><div><br></div></div>
<div>
Barry was not suggesting this.</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div>then this call</div>
<div><br></div><div>  PetscPowScalar(2.0, 0.333)</div><div><br></div><div>will not work correctly. If I do not, then</div><div><br></div><div>  PetscPowScalar(2.0, 3)</div><div><br></div><div>will fail when using --with-64-bit-indices. The only solution I saw was for the user</div>


<div>to do the cast explicitly</div></blockquote></div></div><br><div>We're not saying PetscPowScalar(base,(int)i) is necessarily bad, but we think</div><div class="im"><div><br></div><div><div>#if defined(PETSC_USE_64BIT_INDICES)</div>
<div>
typedef int PowInt;</div><div>#else</div><div>typedef PetscInt PowInt;</div><div>#endif</div></div><div><br></div></div><div>is a pretty ugly way to spell</div><div><br></div><div>typedef int PowInt; /* explanation why */</div>

<div><br></div><div>or even just calling PetscPowScalar(base,(int)i) instead of PetscPowScalar(base,(PowInt)i).</div>
</blockquote></div><br>I am fine with those. Why are we having a discussion then? Just change it.<div><br></div><div>   Matt<br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener<br>
</div>