Sayef Azad Sakin

Final year CS PhD student at the University of Utah

github linkedin email
CV
  • About me
  • Projects
  • Publications
  • Misc Resources
sayefsakin. Powered by Blogger.

Hit Counter

Home » Coding » Bigmod (a^b%m)

Bigmod (a^b%m)

   4:44 PM       Sayef Azad Sakin


 
i64 bigmod(i64 a,i64 b,i64 d) {
	i64 r=1;
	while(b) {
		if(b&1) r=(r*a)%d;
		b>>=1; a=(a*a)%d;
	}
	return r;
}
Email This BlogThis! Share to X Share to Facebook

   Coding

Newer Post Older Post Home

Popular Posts

  • A dedicated NS-3 Module for IEEE 802.22 standard
    Little bit of ranting During my MS Thesis work in 2015, I researched on the resource (subchannel, power) scheduling problem in wireless...
  • Character Device Driver (for linux)
    Little talk..... This was my 3rd assignment in System programming lab(3rd year undergrad course). The main task of this assignment ...
  • Google Summer of Code 2020
    Time Series Updates for Traveler Mentor - Kate Isaacs                In this Google summer project, my goal is to mak...

Categories

  • Coding ( 26 )
  • How to ( 5 )
  • linux ( 4 )
  • Mobile ( 1 )
  • Personal note ( 4 )
  • Quantum Computing ( 1 )
  • resources ( 4 )
  • Summer Work ( 1 )
  • System Programming ( 2 )
  • Thesis work ( 1 )
  • Virtual Router ( 1 )
  • Windows ( 2 )

Blog Archive

  • ►  2020 ( 1 )
    • ►  08/23 - 08/30 ( 1 )
  • ►  2018 ( 1 )
    • ►  01/28 - 02/04 ( 1 )
  • ►  2013 ( 2 )
    • ►  10/13 - 10/20 ( 2 )
  • ►  2012 ( 2 )
    • ►  02/26 - 03/04 ( 1 )
    • ►  02/12 - 02/19 ( 1 )
  • ▼  2011 ( 30 )
    • ►  10/23 - 10/30 ( 4 )
    • ►  10/02 - 10/09 ( 1 )
    • ►  09/04 - 09/11 ( 2 )
    • ▼  08/14 - 08/21 ( 23 )
      • Windows 7 Command Prompt Commands
      • Linux tutorials
      • vi/vim cheat sheet
      • C++ String references with example
      • Strongly Connected Component (Tarjan)
      • Maximum Flow (basic)
      • Minimum Spanning Tree (Kruskal)
      • Max flow with min cut
      • Convex Hull (Grahm Scan)
      • Miscellaneous Geometry
      • Bipartite Matching (Basic)
      • Bellman Ford
      • Bridge Network
      • Articulation Point
      • Single Source Shortest Path (Dijkstra)
      • Bigmod (a^b%m)
      • Number of Divisor
      • Template
      • Prime Factorization
      • Generating Prime (Sieve)
      • Bignumber Subtraction
      • Bignumber Multiplication
      • Bignumber Addition

Strava

Copyright © Sayef Azad Sakin | Powered by Blogger Created By: Widiyanata

TOP