title: Java Math issue incorrect output
body: <p>(51^43)Mod77 in scientific calculator gives 2 as the output however, </p>
  
  <p>(int)(Math.pow(51,43)%(double)77) gives 12 which should be 2 instead.</p>
  
  <p>Can you please help ?</p>