<div class="gmail_quote">On Wed, Jun 1, 2011 at 14:51, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com">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 class="im"><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>
Barry was not suggesting this.</div><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><br><div>We're not saying PetscPowScalar(base,(int)i) is necessarily bad, but we think</div><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>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>