Rod calculus or rod calculation was the mechanical method of algorithmic computation with counting rods in China from the Warring States to Ming dynasty before the counting rods were increasingly replaced by the more convenient and faster abacus. Rod calculus played a key role in the development of Chinese mathematics to its height in Song Dynasty and Yuan Dynasty, culminating in the inventionof polynomial equations of up to four unknowns in the work of Zhu Shijie.