2 Replies - 590 Views - Last Post: 18 April 2019 - 07:49 PM Rate Topic: -----

#1 Tastar   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-April 19

Fast Exponentiation Algorithms

Posted 18 April 2019 - 02:37 AM

Hey am copied fast exponentiation algorithms from thise site https://www.programm...s/#comment-5085 and all give me result = 0 and i dont know why, should i add something on start?
Is This A Good Question/Topic? 0
  • +

Replies To: Fast Exponentiation Algorithms

#2 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6795
  • View blog
  • Posts: 28,082
  • Joined: 12-December 12

Re: Fast Exponentiation Algorithms

Posted 18 April 2019 - 02:40 AM

Post relevant code directly here in the thread, between code tags.
Provide details of input, output and expected output.

Added: Note that we need to see the code, note a screenshot of code.
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 6913
  • View blog
  • Posts: 23,499
  • Joined: 05-May 12

Re: Fast Exponentiation Algorithms

Posted 18 April 2019 - 07:49 PM

The iterative code in that link in broken. Even one of the comments (search for Reaga) is asking how can it possibly work for cases when b is even, since result is only updated when b is odd.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1