Miller Rabin Algorithm

Can you give me the implementation of Miller Rabin Algorithm in C++?

Try to search implementation on google before asking here…

but this code give wrong output in some cases like 999999999999999989.