This is a preliminary draft of a paper to be presented at the conference "The Disunity of Chinese Science" at the University of Chicago, May 10-12. Versions of this paper have been presented at the following forums: Program in History and Philosophy of Science, University of Texas at Austin; Seminars and Colloquia on Late Imperial Chinese Culture and Science, School of Historical Studies, Institute for Advanced Study, Princeton; Annual Meeting of the History of Science Society; and the conference"Intersecting Areas and Disciplines: Cultural Studies of Chinese Science, Technology and Medicine" at the University of California, Berkeley. Please do not circulate beyond this conference or cite without the permission of the author.

Quantifying Ritual: Political Cosmology, Courtly Music, and Precision Mathematics in Seventeenth-Century China

Roger Hart

Departments of History and Asian Studies, University of Texas, Austin

The general outline of Ming mathematics in the received historical accounts is unanimous. Prior to the arrival of the Jesuits, Ming mathematics, along with science and thought in general, was in a state of decline.[2] Chinese mathematics, it is held, reached its apex in the Song and Yuan Dynasties: the thirteenth century has been termed the "zenith of the development of mathematics";[3] the "later phase of the Song marks both the apogee of the development of mathematics in China and its terminal point."[4] During the Ming, this received view asserts, crucial mathematical treatises and techniques from the Chinese tradition were lost;[5] the creativity necessary for mathematical development was stultified by the pervasive Cheng-Zhu orthodoxy and the civil service examinations; mathematics and science were disdained by the inwardly focused followers of Wang Yangming.[6] The most recent studies have only reconfirmed this assessment: during the Ming Dynasty, "classical Chinese mathematics sharply declined";[7] "except for a few subjects . . . mathematics was in a stagnant or even retrograde position in the Ming Dynasty";[8] "there were few important innovations at the highest level of mathematics from the mid fourteenth century until the [advent of the Jesuits in the] seventeenth century";[9] "under the Ming, the major achievements of the Song and Yuan sank into oblivion."[10]

These assertions of the decline Ming mathematics are not, however, conclusions derived from exhaustive studies of Ming mathematics itself: there have been, in fact, no general studies of Ming mathematics;[11] there are few research articles concerning any aspect of Ming mathematics;[12] there have been no systematic analyses of Ming mathematicians and very few studies of individual practitioners;[13] there are no current bibliographies of extant Ming mathematical treatises;[14] the only attempt at a bibliography of Ming mathematics--from the 1930s--has been overlooked.[15] In sum, "decline" has taken as an adequate characterization of mathematics of the Ming thus deemed unworthy of study.[16] And because the mathematics itself did not merit study, these histories of mathematics turned to the larger lessons--social, political, and cultural--that the failure of the Ming Dynasty had to offer. Indeed, the derision for Ming mathematics borrows terms from the narrative of moral decline that might seem hardly appropriate for mathematics--in Needham, "decay," and in Mikami, Ming scholars are termed "degenerate."[17]

What these accounts share is an interpretive framework which derives from the conventional teleological historiography of scientific development. The focus of this historiography is diachronic. Isolated techniques are selectively culled from scientific treatises, separated from their context and anachronistically translated into 'equivalent' modern formulations to serve as benchmarks along a 'rationally reconstructed' teleology leading to present-day science. Cultural and social context enter into these accounts only as general conditions either permitting discoveries and the growth of science (in favorable cases) or, on the other hand, as a distorting factor explaining deviations from the natural development of scientific knowledge. Early versions of this historiography were often secularized hagiographies that transformed flattering biographical materials and the propagandistic claims of the practitioners themselves into historical conclusions; scientific development was explained as the triumph of genius. More recent versions, focusing on the cultural context of science, present anachronistic teleologies leading to the ideologies and social institutions of modern science. In these accounts--with the teleology already given--science is either in a state of development, stagnation, or decline. Only 'development' merits study of the science produced, in order to properly assign credit for scientific discovery. For 'stagnation' and 'decline,' it is the context 'external' to mathematics that becomes the object of criticism.

Studies of 'non-Western' sciences have been framed within this conventional historiography of 'Western' science. The teleology reconstructed from benchmark achievements in the tradition termed 'Western' has then served as the measure of comparison by which other traditions are gauged. That is, these accounts do not reconstruct teleologies derived from mathematics in China; instead they seek equivalents--under proper translation--for the already reconstructed teleology of the West. The central issue then becomes priority: scientific practices merit study if they can be shown to be first in this contest between civilizations. More specifically, in the case of Chinese mathematics, the development of notations and solutions for polynomial equations has seemed to provide a natural teleology with modern mathematics as its endpoint: increasingly higher exponents and more variables gauged progress, giving a natural direction of growth; more importantly, this teleology made cross-cultural comparisons of Europe and China possible, reaffirming a golden age in the Song and early Yuan during which the glories of China outshone those of the West.[18]

The new historiography of science begins from a very different point of departure.[19] The focus is synchronic, or more specifically, microhistorical. The social and cultural is not separated from knowledge as its 'context' but rather becomes a fundamental constituent in the co-production of knowledge, self-fashioned identities, status, and credibility. If the conclusions of the new historiography often represent radical revisions of the old, it is less a shift in methodological approaches than the scrupulous attention to historical evidence and documentation.[20]

This article proposes--as an alternative to the conventional historiography of mathematics in seventeenth-century China--to adopt this cultural approach to examine ritual, music, and mathematics in seventeenth-century China in its humanistic context. The focus is Zhu Zaiyu's (1536-1611) Complete Compendium of Music and Pitch (Yuelü quan shu) and in particular the mathematics presented in his New Explanation of the Theory of Calculation (Suanxue xinshuo, engraved in 1604). Zhu's mathematics is perhaps some of the most sophisticated found in extant texts from the Ming Dynasty, yet he is rarely even mentioned in studies of Ming mathematics; his New Explanation of the Theory of Calculation has been overlooked.[21] The research works that have been written on Zhu have been framed within the old historiography, and in particular the project of Joseph Needham's "grand titration" which was to redistribute scientific credit among civilizations; their central focus has been Zhu's work in music and in particular the asserted priority of Zhu's discovery of the equal temperament of the musical scale. In these hagiographic accounts, Zhu is portrayed as a scientist; the central focus of his work--the recovery of ancient ritual--is rarely mentioned.[22]

This paper is divided into four parts. The first examines in detail the philosophical theories of ritual music expounded in the Record of Music (an example of what Joseph Needham termed 'correlative thinking'). The second section examines attempts to recover the ritual music of antiquity as a solution to Ming Dynasty crises. The third examines Zhu Zaiyu's proposals for the reform of astronomy and ritual music. And the fourth focuses on the mathematical solutions he offered for recovering the music of antiquity--the equal-temperament of the musical scale, calculated to twenty-five decimal places using nine abacuses. 'Correlative thinking,' conservative Confucian textualism, the symbolic rituals of the absolutist imperial court, and the commercial mathematics and abacus of the merchants--all have been blamed for inhibiting the development of science; this paper explores how they were combined in Zhu's work.


In the conventional historiography in which grand comparisons of the sciences of civilizations were to isolate the causes of scientific development, many explanations have been offered--institutional, social, economic, and linguistic--for the absence of Science, Modern Science, or a Scientific Revolution in China.[23] One of the most common themes is what has been termed 'correlative thinking.'[24] For Joseph Needham, correlative thinking was one of the central differences between China and the West; one of the central examples Needham offers is Dong Zhongshu's (179?-104? B.C.) theory of music and the sympathetic resonance of musical tones.[25] For later writers, 'correlative thinking' and variants of Chinese metaphysics remained little more than a philosophical context which inhibited or prevented science;[26] "as the result of a highly sophisticated metaphysics there was always an explanation--which of course was no explanation at all--for anything puzzling which turned up."[27] Even the most sophisticated of recent comparative studies continue to characterize Chinese thought as essentially correlative;[28] recent critical studies of science continue to assert that the nonseparability of 'nature' and 'society' was the central reason for the lack of development outside the West.[29] In these accounts, having labeled thought as 'correlative thinking' and thus as inhibiting science, there has been little need for further study, except for negative comparison to ideologies held to have aided the development science. In order to better understand the historical tradition that Zhu sought to recover, and its constitutive role in Zhu Zaiyu's work, we must first seek to examine these philosophical theories.[30]

A central text for understanding the role of music in politics and ritual in China is the Record of Music (Yue ji), the earliest extant Chinese work on the theory of music.[31] The relationship between music, ritual, and politics in China was also a topic of considerable debate in early Chinese philosophical texts. In Mozi, music is an extravagant waste of resources which burdens the subjects without providing them benefit.[32] Zhuangzi contains several passages exhorting the rejection of ritual and music.[33] The Analects (Lun yu) includes a component on aesthetics, arguing for the balanced synthesis of patterning (wen) and substance (zhi); this theory of aesthetics is then integrated into a larger ethics of the superior man (junzi), which includes a theory of education, proper behavior, political conduct, and morality.[34] Recent archeological evidence further verifies the important role music played in ritual ceremony and politics.[35]

The Record of Music adds to these early formulations a sophisticated theory of mind. Music is produced as a reaction to external stimuli on the mind (xin);[36] it is this theory of mind that establishes the necessity of the intervention of the monarch--through rites, music, government and punishments--to regulate the minds of the subjects, thus bringing order to the nation. The Record of Music begins with the investigation of individual sounds (sheng) which are then combined into tones (yin),[37] and ultimately form music (yue); parallel to music, the analysis of society begins with the investigation of the individual, which in aggregate then forms society. Thus, "Examine sound and thereby comprehend tones, examine tones and thereby comprehend music, examine music and thereby comprehend government";[38] "the principles of sound and tones (sheng yin zhi dao) are the same as those of government."[39]

The theory of individual sounds in the Record of Music is based on a theory of the relationship between the mind and objects (wu) outside the mind. In the nature of the human mind inheres both a state and a potential: the human mind in its original state (at birth) has no desires or feelings--this is the nature of the human mind that is derived from heaven (tian). But also in the nature of the mind is the capacity to produce feelings and desires, which occurs only through exposure to external objects. Through the effect of objects on the potentiality of the mind (desire), the mind is brought into activity from its original stillness, defining a new state (xing) of the mind.[40] Thus desire, feelings, and knowledge are not innate; the form of the mind is a reaction of the mind to the stimuli of external reality according to the nature the mind derives from heaven.[41]

It is through sound that this state--the reaction of the inner mind to external stimuli--is manifested in the external world. Sound, similar to the reactive nature of the mind to objects, is a reactive expression of the stimulus received by the mind. The six qualities of sound (dread, freedom from worry, coming forth, severity, solemnity, and peacefulness) reflect the six states of the mind (melancholy, joy, happiness, fury, respectfulness, adoration) which are determined by the influence of objects; the state of mind is reflected by the quality of sound, not by which particular one of the five sounds is produced. The five sounds gong, shang, jue, zhi, yu individually correspond to hierarchical elements of the metaphysical system: the sovereign (jun), ministers (chen), subjects (min), affairs (shi) and objects.[42] Discord in any of these individual sounds is manifested in distortion of the sound (gong becomes undisciplined, shang becomes abnormal, jue becomes fretful, zhi evinces grief, and yu evinces danger), and reflects discord in the corresponding category (arrogance of the sovereign, corruption of the ministers, discontent of the subjects, overburdening of the subjects, and scarcity of resources). Sound is thus individual in its production, reflecting the form of the mind of the individual; the five sounds each represent an individual element of society.

Tones, the combination and transformation of individual sounds, corresponds to society, which is the combination and transformation of individuals.[43] When sounds are manifested, they resonate with similar sounds.[44] This resonance is not enough to be tones, however: tones are the result of the combination of various sounds and their transformation into intricate patterns. As a reflection of society, the three qualities of tones (peacefulness, resentment, grief) correspond to the three states of the nation (order, chaos, demise), and to three states of government (harmony, perversity, hardship). Zheng and Wei are examples of the music of disorder; the music of the "Mulberry Grove on the River Pu" is an example of the music of the world in demise.[45] Similarly, if the five sounds are all in discord, the five elements thus in discord, then the demise of society is immanent.

Music is the coordination of tones and the combination with various forms of dance.[46] Music, then, is a code of behavior similar to the rites: it is part of the political system. Beasts are capable of understanding sounds only; the subjects are capable of understanding tones only; but the superior man can understand music. Music, unlike sound and tones, is not reflective of the state of the individual or of the society: it is the production of a code that orders society. It is the construction of the political system, and performs a political function through the regulation of society.

The need for the regulation through music is then based on this theory. The feelings of the mind are reactions to the objects that it comes in contact with; they are not constant, and not determined by human nature (which is originally still). With increasing exposure to the external reality, knowledge increases and desires multiply. After this the likes and aversions are formed. But the ability of external reality to excite the mind is unlimited, and if these likes and aversions are not moderated within the inner mind, the mind will be seduced by the external, leading to the degeneration of man by objects. This degeneration results in the destruction of the principles of heaven, and the appearance of all the ills of society (deceit, rebellion, violence). This is the danger to which the theory of The Record of Music offers a political solution. The sovereign must prudently moderate the states of mind of the subjects, using rituals (li), music (yue), punishments (xing), and law (zheng).

Thus the monarch must intervene politically: following the example of the early kings, he is careful to moderate the minds of the subjects through controlling that which will affect them. The monarch uses the regulation of music to create harmony, rites to enforce differentiation, government to guide their will and punishments to prevent transgressions. The rites and music are not for sensual pleasure, but educate the subjects in the moderation of their desires and aversions, guiding them back to the correct path and creating social stability. Rites, music, government and punishments are the ultimate unity; when all are attained, the harmonious universe is attained. The world can be governed only when the minds of the subjects are united.

Music and rites are thus complementary in governance: while the rites enforce differentiation of the base and refined, music harmonizes through common emotions. The differentiation results in mutual respect and thus preserves the existing order without conflict; the unification of music allows for closeness and thus eases resentment. The dominance of one over the other produces instability; the synthesis of rites and music is the synthesis of order and emotion. Music harmonizes heaven and earth; the rites order it. The synthesis of the differentiation of rites and the harmonizing of music creating a ordered universe then becomes a natural law which provides theoretical support for the state.


During the latter part of the Ming Dynasty (1368-1644), scholar-officials sought to recover the institutions and ritual order of early China as solutions to the perceived decline of the moral order.[47] A central feature of the intellectual context of this period was the civil examination system. The received historiography--following the polemics of Chinese Westernizers after the Opium Wars--has viewed this examination system as little more than oppressive. Recent work by Benjamin Elman has shown, however, that the imperially-sanctioned power projected in the civil examinations was not merely a tool for reproducing political orthodoxy and social hierarchies,[48] but was also productive in enforcing competence among elite literati in Confucian moral philosophy, statecraft, literary writing, and also "natural studies." Based on his comprehensive analysis of extant Ming dynasty civil examinations, Elman argues that although questions on "natural studies" were less frequent than some of the other categories, these questions appeared often enough during the Ming to force between 50,000 and 100,000 candidates for each triennial administration of the provincial examinations to gain technical competence in astronomy, calendrics, and music.[49] The result at the elite level of society was, Elman argues, a scholarly reorientation that incorporated "natural studies" into Confucian "broad learning." The growth of the examination system, then, contributed to proficiency in astronomy, music, and mathematics by the scholar-officials of the period. And along with memorials on topics ranging from military policy and taxation to the moral order, solutions to the problems of calendrics and ritual music were offered in bids for imperial favor.[50]

Proposals in the 1530s for the reform of ritual music--used to reinforce the symbolic order of the state (as in Europe)[51]--have been described in some detail in Joseph Lam's study of the execution of the powerful grand secretary Xia Yan (1482-1548).[52] Xia Yan proposed in 1530 to implement ancient sericultural ceremonials, and it was in this context that Zhang E presented solutions to the problems of ritual music: "Zhang E's proposal to measure the huangzhong pitch with ether [qi], to make the large special bell (tezhong), and to enforce certain musical changes were attempts to attain the perfect ritual music, which would allow communication among and coordinate human beings, natural elements, and supernatural forces, and would demonstrate the authority and power of Shizong."[53] Zhang E was banished from the court in 1536. Lam suggests that ultimately "Zhang E's efforts were, however, more ideological than practical. Given the limitations in his theories and technological data, he did not and could not resolve the musical ambiguities concerning pitch measurement, musical instruments, performance practices, and other musical matters. Zhang E's solutions were only as valid or invalid as others."[54] It was precisely this set of questions that Zhu Zaiyu addressed in his work; the nature of these debates suggests the reasons for the solutions that Zhu offered.


Zhu Zaiyu was the heir apparent of the sixth prince of Zheng (Huaiqing fu, in present-day Henan Province), a post held by his father Zhu Houhuan (1518-1591).[55] At age 14, his father was deposed after being accused of treason by a cousin; he was sent to prison in Fengyang (present-day Anhui Province). Accounts describe Zhu Zaiyu as living in poverty in a simple hut outside the estate and devoting himself to learning during the period of his father's imprisonment. His work was presented to the imperial court in memorials urging reform in astronomy and music.

Secondary research works written on Zhu have focused on his studies of music,[56] and the asserted priority of his discovery of equal temperament of the musical scale.[57] The majority of Zhu's extant works, however, are related to ritual aspects of music, dance, and calendrics, submitted to the court as proposed solutions to the problems of ritual. These works were collected together and published in his Complete Compendia of Music and Pitch (Yue lü quan shu),[58]which was itself presented to the court. Because of this and his status, the Complete Compendia of Music and Pitch seems to have been widely disseminated: close to one hundred copies are recorded in bibliographies of books presented to the editors of the Complete Compendia of the Four Treasuries (Si ku quan shu);[59] rare Ming editions are still extant in libraries throughout China.[60]

The treatises in Zhu's Complete Compendia of Music and Pitch cover a variety of topics related to the recovery of the institutions and rituals of the ancients. It includes works on calendrics (examples include the Wan nian li bei kao, Sheng shou wan nian li, and Lü li rong tong, yin yi). The majority of the works are on topics related to his analysis of ritual music of antiquity: New Explanation of Music Theory (Yue xue xin shuo); New Explanation of the Theory of Pitch (Lü xue xin shuo); The Twelve Pitches: Essences and Meanings, Inner and Outer Chapters (Lü lü jing yi nei bian, Lü lü jing yi wai pian); Score for Music for Two-Tone Bells (Xuan gong he yue pu), Score for Poetry and Music at Provincial Banquets (Xiang yin shi yue pu), Score for Ancient Music and Dances with Silk (Cao man gu yue pu, Scores for the Smaller Dances and Provincial Music of the Six Dynasties (Liu dai xiao wu xiang yue pu), and Scores for Smaller Dances and Provincial Music (Xiao wu xiang yue pu). Zhu's works also include philosophical analyses of music, such as his "General Summary of Song [Dynasty] Zhu Xi's Discussion on Dance" (Song ru Zhu Xi lun wu da lue),[61]

Several examples from his illustrations will suffice to show the range of Zhu's work on the recovery of ritual. He investigated the transformations of pitches (Figure 1) and their relation to the hexagrams from the Book of Changes (Figure 2). He attempted to reconstruct the instruments described in the Classics (Figure 3). His study of dance included illustrations of the proper steps (Figure 4), proper movements (Figure 5), and the proper arrangements (Figure 6). To understand his proposal for the recovery of the tones of antiquity, we must look at his mathematical work.

Figure 1: The transformations of the pitches.

Figure 2: The correspondence between pitches and the hexagrams.

Figure 3: Instruments of antiquity.

Figure 4: Proper steps in dance.

Figure 5: Proper movements in dance.

Figure 6: Proper arrangement in dance.


To recover the tones that harmonized heaven and earth in antiquity, Zhu proposed mathematical solutions, outlined in his his New Explanation of the Theory of Calculation (Suan xue xin shuo, engraved in 1604).[62] (Zhu also published several more minor works on mathematics,[63] and an additional musical treatise.)[64] Zhu used geometric ratios instead of fractional proportions to divide the musical scale in the following manner,

resulting in the equal-tempered scale. Zhu then calculated the values for the equal-tempered scale to twenty-five decimal places; he also calculated the values of lengths in a base 9 numbering system for music.

Zhu's New Explanation of the Theory of Calculation presents its mathematics beginning from the most elementary definitions. Its contents include the following: a list of the numbers from one to one hundred; a list of the terms for each decimal place for "large numbers"--from 100 to 1024 (Figure 7). and for "small numbers" from 10-1 to 10-9 (for even smaller magnitudes, Zhu simply writes them without terms); terms for areas and for volumes; a table for looking up the nearest integral roots which lists the squares from one to nine, ten to ninety by tens, and one hundred to nine hundred by hundreds; cubes from one to nine, ten to ninety by tens, and one hundred to nine hundred by hundreds; a discussion on the differences between the base-10 system for measuring musical tones and the base-9 system.

Figure 7: Introduction to elementary arithmetic.

This is followed by a short discussion of the metaphysical He tu diagram, relating the five directions, the five phases (earth, metal, wood, fire, and water), the five sounds, and the five elements of the metaphysical system:

Five and ten reside in the center, representing earth, gong, and the sovereign;
Four and nine reside in the West, representing metal, shang, and the ministers;
Three and eight reside in the East, representing wood, jue, and the subjects;
Two and seven reside in the South, representing fire, zhi, and affairs;
One and six reside in the North, representing water, yu, and objects.

This is followed by his precision calculations of the values for the equal-tempered system. In the received historiography, the abacus has been viewed as "extremely well suited to the routine needs of the growing urban merchant class. Because the abacus could only represent a dozen or so digits in a linear array, it was useless for the most advanced algebra until it was supplemented by pen-and-paper notation."[65] One example of Zhu's mathematics is his calculation, using nine abacuses, of the square root of 200 to 25 decimal places, or 14.14213562373095048801689 (Figure 8).

Figure 8: Precision calculations to twenty-five decimal places.

Contrary to the simplicity of the introductory sections of the text, neither the general method nor the steps for the calculation is explained in detail. The method he uses, in modern terminology, is as follows: to find the square root of x, let rn be the approximation of the root to the (n-1)th place, and to find the value of nth place dn, then we seek for the largest integer for dn such that

Rearranging terms, the above is equivalent to the following formula:

The calculations are performed recursively. The first term r1 is simply the first decimal place of the root, in this case it is 10. Then assume that rn is given from the previous step. All that remains is to test for the largest integer dn such that is less than the remainder term: the remainder term on the right side has already been calculated from the previous step (see below); is easily calculated; in general, the term dn2 is small (see the table below for examples); so this is essentially amounts to dividing into the remainder (possibly leaving extra for dn2). Then subtracting from the remainder term gives the next remainder term--that is, since ,

This formula can be written as an algorithm.[66] The successive values that Zhu computes are shown in the following table:

Zhu then calculates the value for ; he then finds the square root to calculate the value for ; and finally he takes the cube root of that to find the value for .


The conventional histories of mathematics selectively recounted benchmark achievements wrenched from mathematical context and transfigured to fit into anachronistic teleologies never available to the practitioners. This 'internal' teleology offered an explanatory framework to fill the void which remained after the effacement of the social, political, cultural and scientific context. Three choices remained: 'development,' 'stagnation,' and 'decline.' In these accounts, with time collapsed, labor effaced, and applications denied, discoveries in mathematics indeed appeared miraculous. Individual genius recounted in hagiographies became the only explanation. With the context and applications separated from the knowledges produced, the 'unreasonable effectiveness' of mathematics then became a perplexing problem in need of explanation.

The recent turn toward cultural studies of science has seemed to validate externalistic 'macrohistories'--studies which too often refused to examine any of the details of the mathematics they purportedly attempt to explain--which provide equally anachronistic teleologies. One genre has focused on social institutions and the status of mathematicians: in these, social status is viewed not as relational, not as the site of social conflict, but rather as being conferred by society; society then becomes the culpable agent responsible for the low status of mathematicians and thus the failure to gain the benefits (known through hindsight) of mathematical knowledge. Another genre focuses on ideologies. In these, beliefs transparently produce their claimed results; thus subscriptions to particular ideologies--whether keguan weiwu zhuyi (objective materialism), naturalistic Daoism, or interest in the 'book of nature'--result in scientific development; insensitivity to 'anomalies', correlative thinking, idealism, or Confucian philosophy then stunt scientific development.

In these accounts, the Ming dynasty was nothing but a period of decline, a claim which was circularly reinforcing--the absence of research on Ming mathematics only reconfirmed that there was no mathematics worthy of study. 'Correlative thinking,' conservative Confucian textualism, the absolutist imperial court, and the commercial mathematics and abacus of the merchants were each blamed for inhibiting development; the mathematical work of Zhu Zaiyu was rarely even mentioned.

This paper took a cultural approach to study mathematics in the context of the humanistic scholarship of the late Ming. The philosophical system of the Records of Music--an example of what Needham termed 'correlative thinking'--linked proper governance to proper expressions of music: the rites ordered heaven and earth; music harmonized them. The perceived decline in the late Ming moral order led to efforts to reconstruct the ritual systems outlined in the Confucian classics. Zhu Zaiyu systematically studied musical ceremony to recover these systems--instruments, dance, musical scores, and mathematical harmonics--and presented his proposals to the imperial court as solutions to Ming crises. Zhu's attempt to legitimate his system of musical equal-temperament depended not just on his invocations of the classics, but also to the availability of the abacus. By placing nine abacuses together, Zhu was able to calculate the lengths of musical pitch-pipes to twenty-five decimal places. This study suggests that through a bricolage of historical contingencies--mathematical knowledge probably obtained from recluses, the inelegant abacus of the despised merchant class, the recovery of ancient musical rituals, and an attempt at patronage by buttressing conservative political theories--Zhu solved the mathematically tractable problem of the equal temperament of the musical scale, and provided solutions to twenty-five place precision.

I would like to thank Benjamin Elman, Mario Biagioli, Timothy Lenoir, Michael Mahoney, and Ted Porter for detailed criticisms on earlier drafts. Versions of this paper have been presented at the conference "Intersecting Areas and Disciplines: Cultural Studies of Chinese Science, Technology and Medicine" (Center for Chinese Studies, UC Berkeley) and the History of Science Society. I would like to thank all those who offered comments and criticisms.

[1]Ludwig Wittgenstein, Remarks on the Foundations of Mathematics, trans. G. E. M. Anscombe (Cambridge: M.I.T. Press, 1967), 260, 262.

[2] See Joseph Needham and Wang Ling, Science and Civilisation in China, vol. 3, Mathematics and the Sciences of the Heavens and the Earth (Cambridge: Cambridge University Press, 1959), 50-52; U. Libbrecht, Chinese Mathematics in the Thirteenth Century, the Shu-shu chiu-chang of Ch'in Chiu-shao (Cambridge: MIT Press, 1973), 13; Yoshio Mikami, The Development of Mathematics in China and Japan (New York: Chelsea, 1974), 108, 112; Li Yan and Du Shiran, Chinese Mathematics: A Concise History, trans. John N. Crossley and Anthony W.-C. Lun (Oxford: Clarendon Press, 1987), 175; Qian Baocong A History of Chinese Mathematics (Zhongguo shuxue shi) (Beijing: Kexue chubanshe, 1992), 234 ff.; and Mei Rongzhao "An outline of Ming-Qing mathematics" (Ming-Qing shuxue gailun) in Essays on the History of Ming-Qing Mathematics (Ming-Qing shuxueshi lunwenji), 1-7.

[3] Li Yan and Du Shiran, Chinese Mathematics, title of chapter 5, 109.

[4] Libbrecht, Chinese Mathematics in the Thirteenth Century, 2.

[5] Mikami, The Development of Mathematics in China and Japan, 108, 112; Li Yan and Du Shiran, Chinese Mathematics, 175; Qian Baocong, A History of Chinese Mathematics 234 ff.; Mei Rongzhao "An outline of Ming-Qing mathematics," 1-7.

[6] Mei Rongzhao, "An outline of Ming-Qing mathematics," 5; Qian Baocong, "The Relationship between Mathematics and Daoxue during the Song and Yuan Dynasties" (Song Yuan shiqi shuxue yu Daoxue de guanxi), in Selected Essays by Qian Baocong on the History of Science (Qian Baocong kexueshi lunwen xuanji) (Beijing: Kexue chubanshe, 1983), 238-9; Mei Rongzhao, Wang Yusheng "The Mathematical Thought of Xu Guangqi," (Xu Guangqi de shuxue sixiang), in Xu Guangqi yanjiu lunwenji, 41.

[7] Guo Shuchun states: "not only did this period fail to produce works comparable to the Shu shu jiu zhang or the Si yuan yu jian, earlier Song achievements such as the Four-Origin technique (si yuan shu) and root extraction were not understood." Guo Shuchun, "Introduction," Comprehensive Compilation of the Chinese Technological and Scientific Classics (Zhongguo kexue jishu dianji tonghui--shuxue juan), (Henan: Henan jiaoyu chubanshe, 1993), 1:18-19.

[8] Liu Dun lists the causes as i) "the lack of creative mathematicians"; ii) "the scarcity of paradigmatic works such as the Jiu zhang suan shu and the Shu shu jiu zhang"; iii) "the lack of problems with a heuristic significance." Citing Gu Yingxiang as an example, Liu further argues that "Ming Dynasty scholars had only a superficial knowledge of earlier mathematics, and most important mathematical works, along with their outstanding achievements, were virtually unknown, and some had been lost." Liu's assessment of the Ming is the most positive of any historian; it should be noted that, in contrast to his overall assessment of the Ming dynasty, Liu later terms Cheng Dawei a "pioneer" (103-4). Liu Dun, "400 Years of the History of Mathematics in China--An Introduction to the Major Historians of Mathematics since 1592," Historia Scientiarum 4: 103-111 (1994).

[9] Nathan Sivin, "Science and Medicine in Chinese History," in Science in Ancient China: Researches and Reflections (Brookfield, Vermont: Variorum, 1995), 172; revised version of "Science in China's Past," in Science in Contemporary China, ed. Leo Orleans (Stanford: Stanford University press, 1980), 1-29.

[10] Jean-Claude Martzloff, "Chinese Mathematics," in Companion Encyclopedia of the History and Philosophy of Mathematical Sciences, ed. I. Grattan-Guinness (New York: Routledge, 1994), 99. The remainder of the section discusses the introduction of Western mathematics.

[11] The only book that covers Ming mathematics, Collected Essays on the History of Mathematics during the Ming and Qing Dynasties (Ming-Qing shuxue shi lunwen ji) (Nanjing: Jiangsu jiaoyu chubanshe, 1990), ed. Mei Rongzhao, offers only a very brief overview of Ming mathematics, "Synopsis of the History of Mathematics during the Ming and Qing Dynasties" (Ming-Qing shuxue shi gailun), 1-20.

[12] General histories of Chinese mathematics such as Mikami's Development of Mathematics in China and Japan, Li Yan and Du Shiran's Chinese mathematics, and Needham's Science and Civilisation devote only a few pages to the Ming; their primary focus is the introduction of Western mathematics.

[13] Some recent articles have examined the work of Cheng Dawei. The best work is "Cheng Dawei and His Mathematical Work" (Cheng Dawei ji qi shuxue zhuzuo by Yan Dunjie and Mei Rongzhao, in Collected Essays on the History of Mathematics during the Ming and Qing Dynasties, 26-52. Yan and Mei argue (incorrectly) that Cheng was the greatest of Ming mathematicians; his work is important only against the background of the "backwardness of traditional mathematics in the Ming dynasty."

[14] General bibliographies in Western languages of Chinese mathematics cite only a fraction of the extant Chinese mathematical treatises. The bibliography in Libbrecht's Chinese Mathematics in the Thirteenth Century is not comprehensive because of its stated focus on the Song, after which, Libbrecht asserts, Chinese mathematics declined. He refers to only one Ming treatise. Catherine Jami's "Western Influence and Chinese Tradition in an Eighteenth Century Chinese Mathematical Work," Historia Mathematica 15 (1988): 311-331, contains a reference to only the treatise studied; the bibliography in Frank J. Swetz and Ang Tian Se, "A Brief Chronological and Bibliographic Guide to the History of Chinese Mathematics," Historia Mathematica 11 (1984): 39-56, provides no information not found in general histories. Other articles have focused on primarily on Song and pre-Song. General histories, such as Martzloff's Histoire des mathématiques chinoises (Paris: Masson, 1988) contain few references to Ming mathematics; Li Yan and Du Shiran's Chinese Mathematics and Mikami Yoshio's Development of Mathematics in China and Japan contain no bibliography of sources but only mention titles within the text. For a bibliography, the reader of Li Yan and Du Shiran's Chinese Mathematics is referred to Needham's Science and Civilisation in China, vol. 3, which is not specialized enough to list more than several titles--the primary focus is on astronomy and the Jesuit impact. The most important sources are approximately 20 Chinese bibliographies on mathematical treatises which, however, are not current.

[15] Li Yan, "Bibliography of mathematical works of the Ming Dynasty" (Mingdai de suanxue shuzhi), in Collected essays on Chinese mathematics (Zhong suan shi luncong), (Beijing: Kexue chubanshe, 1954-55) v. 2, 86-102. Reprinted from Library science quarterly (Tushuguan xue jikan) 1.4 (1926) 667-682. See also "Zengxiu Ming dai suanxue shuzhi" (Additions and revisions to the bibliography of mathematical works of the Ming Dynasty), in Zhongguo suanxueshi luncong. Reprint from Tushuguanxue jikan (Library science quarterly) 1.5 (1926): 2123-2138. I have seen no discussion of the contents of this bibliography in Western or Chinese sources.

[16] Elsewhere I have presented evidence against the claim that mathematical treatises from previous dynasties were lost and have offered a preliminary overview of the mathematical treatises written during the Ming. I have also argued that claims of Ming mathematical decline in fact derive from the Jesuit religious propaganda of Matteo Ricci, Xu Guangqi, and Li Zhizao, adopted as conclusions in the later historiography. Roger Hart, "Proof, Propaganda, and Patronage: The Dissemination of Western Studies in Seventeenth-Century China," (Ph.D. diss., University of California, Los Angeles, 1997).

[17] "Ming scholars were so degenerate that they were little able to understand the celestial element [celestial origin] algebra and that the calendrical reform was left unaffected although the prevalent calendar had become very loose and inaccurate with the lapse of years." Mikami, Development of Mathematics in China and Japan, 112.

[18] For a criticism of this standard account, see Roger Hart, "Local Knowledges, Local Contexts: Mathematics in Yuan and Ming China," MS.

[19] Two important examples of this historiography are Steven Shapin and Simon Schaffer, Leviathan and the Air-Pump: Hobbes, Boyle, and the Experimental Life (Princeton: Princeton University Press, 1985); and Mario Biagioli, Galileo, Courtier: The Practice of Science in the Culture of Absolutism (Chicago: University of Chicago Press, 1993).

[20] Although this new historiography has often been framed in claims of relativism following work in the sociology of scientific knowledge, relativism is not inherent in this historiography but rather has served as an initial response to universalist claims in the conventional accounts.

[21] Zhu's New Theory of Calculation is mentioned as an extant mathematical treatise in Mei Rongzhao, "Ming-Qing shuxue gailun," in Ming Qing shuxue shi lun wen ji, 1-2. However, more typical is Martzloff's History of Chinese Mathematics, in which Zhu is mentioned only briefly as having proposed a project to reform the calendar (21).

[22] See footnote 56 for sources.

[23] Among the purported differences are the following: linguistic (alphabetic vs. 'ideographic' scripts, the existence vs. non-existence of the copula, poetic vs. scientific, theoretical vs. practical, abstract vs. concrete), economic (capitalism), political (democracy vs. Oriental despotism), to name a few. No satisfactory answer has ever been posed. For two recent examples see Toby E. Huff, The Rise of Early Modern Science: Islam, China and the West (Cambridge: Cambridge University Press, 1993); Derk Bodde, Chinese Thought, Society, and Science: The Intellectual and Social Background of Science and Technology in Pre-Modern China (Honolulu: University of Hawaii Press, 1991).

[24] Others candidates have included conceptions of natural law, the ordering of time and space, and demonstrative logic vs. consensus.

[25] Joseph Needham, Science and Civilisation in China, vol. 2, History of Scientific Thought (Cambridge: Cambridge University Press). Elsewhere, Needham describes the difference as one between organic and mechanical philosophy (along with three other fundamental differences between China and the West--algebraic vs. geometrical euclidean geometry, wave vs. particle, and practical vs. theoretical). Joseph Needham, "Poverties and triumphs of the Chinese scientific tradition," in The Grand Titration: Science and Society in East and West. Boston: G. Allen & Unwin, 1979), 21-23. For further accounts of 'correlative thinking,' see also Benjamin Schwartz, The World of Thought in Ancient China (Cambridge: Belknap Press of Harvard University Press, 1985), 350-82; A. C. Graham, Yin-Yang and the Nature of Correlative Thinking, vol. 6 of the Institute of East Asian Philosophies Monograph Series (Singapore: University of Singapore, 1986); and idem, Disputers of the Tao: Philosophical Argument in Ancient China (La Salle, Illinois: Open Court, 1989), 313-56.

[26] John B. Henderson, The Development and Decline of Chinese Cosmology (New York: Columbia University Press, 1984), 246-56.

[27] Mark Elvin asserts that "the consequences of this [Wang Yangming's] philosophy for Chinese science were disastrous" and continues, "given this attitude, it was unlikely that any anomaly would irritate enough for an old framework of reference to be discarded in favor of a better one." Mark Elvin, The Pattern of the Chinese Past: A Social and Economic Interpretation (Stanford: Stanford University Press, 1973), 234. Elvin's conclusion is presumably based on the analysis of shifts in conceptual schemes or paradigms articulated in Thomas S. Kuhn, The Copernican Revolution: Planetary Astronomy in the Development of Western Thought (Cambridge: Harvard University Press, 1957) and idem, The Structure of Scientific Revolutions, International Encyclopedia of Unified Science, 2d ed., enl. (Chicago: University of Chicago Press, 1970 [1962]). Lothar von Falkenhausen, in Suspended Music: Chime-Bells in the Culture of Bronze Age China (Berkeley and Los Angeles: University of California Press, 1993), suggests correlative thinking formed a "numerological straightjacket" (4).

[28] G. E. R. Lloyd reaffirms the general validity of the characterizations of a "cause-oriented Greek culture and a correlation-oriented Chinese one" (93), while noting that the Greeks "were no strangers to correlative thinking" (94) and "Chinese interest in the explanation of events is certainly highly developed in such contexts as history and medicine" (109). Lloyd, Adversaries and Authorities: Investigations Into Ancient Greek and Chinese Science, Ideas in Context (Cambridge: Cambridge University Press, 1996).

[29] Although Bruno Latour does not specifically address China and correlative thinking, he argues that what differentiates the Premodern (in both the West and non-West) from the Modern West is that "the nonseparability of natures and societies had the disadvantage of making experimentation on a large scale impossible, since every transformation of nature had to be in harmony with a social transformation, term for term, and vice versa" (140). This asserted difference underwrites the three central hypotheses of his book: i) for the Moderns, purification makes hybrids possible; ii) for the Pre-moderns, conceiving of hybrids excluded their proliferation; and iii) the Non-modern present must "slow down, reorient, and regulate the proliferation of monsters by representing their existence officially" (12). Latour, We Have Never Been Modern, trans. Catherine Porter (Cambridge: Harvard University Press, 1993). Latour provides no historical evidence for this claim which is in fact strikingly similar to conventional anthropological caricatures of the non-Western and pre-modern.

[30] For an example of a study in European thought, see Michel Foucault's analysis of conventia, aemulatio, analogies, and sympathies. Foucault, Les Mots et les choses: une archeologie des sciences humaines, Biblothèque des sciences humaines (Paris: Gallimard, 1966); translated as The Order of Things: An Archaeology of the Human Sciences (New York: Vintage Books, 1973).

[31] The Record of Music now exists as a section in the Record of Rites (Li Ji). According to bibliographic records, it was compiled by Liu Xiang (77 B.C.-6 A.D.), who collated and edited it to 23 sections (pian); the version included in the Record of Rites (Li ji) has been further edited to eleven sections. The origin of the text is still undetermined. The edition consulted here is included in the Record of Rites in the Thirteen Classics, with Annotations and Secondary Annotations (Shisan jing zhu shu) (Beijing: Zhonghua shuju, 1980). The Record of Rites contained in the Thirteen Classics is annotated first by Zheng Xuan (127-200 A.D.). Secondary annotations were added by Kong Yingda (547-648), a scholar of the classics during the Tang Dynasty who held the titles of Erudite of the National University (guozi boshi) and Chancellor of the National University (guozi ji jiu). He was commissioned by Emperor Taizong of Tang to edit the Correct Interpretation of the Five Classics (Wu Jing Zheng Yi). Shen Yue (441-513 A.D.) linked the Record of Music to the Confucian tradition, claiming that it was transmitted by Confucius to his disciple Gongsun Nizi (of the early Warring States Period). For an analysis of the compilation of the Records of Rites, see Michael Loewe, ed., Early Chinese Texts: A Bibliographical Guide, vol. 2 of Early China Special Monograph Series (Berkeley: Society for the Study of Early China, Institute of East Asian Studies, University of California, Berkeley, 1993), s.v.

[32] "Against Music" (fei yue), in Mozi. For analysis of the compilation of this and the following early philosophical texts, again see Loewe, ed., Early Chinese Texts.

[33] Zhuangzi, Collected Explanations (Zhuangzi ji shi), (Beijing: Zhonghua shuju, 1961), 284, 321, 341, 486.

[34] Lun yu (Beijing: Zhonghua shuju), nnn.

[35] See Falkenhausen, Suspended Music.

[36] It is this same theory of mind that is later revived as a foundation in later Confucian philosophy, and is central in the debate on the origin of desire.

[37] For a more precise explanation of the term yin, see below.

[38] Record of Music, 1528.

[39] Record of Music, 1527.

[40] SECONDARY ANNOTATIONS: "'Affected by objects, [the mind] is brought into activity, which is then manifested in sound' means that when the human mind has already been affected by external objects, and the mouth becomes active to express the mind, the state (xing) of the mind is expressed in sound. If the mind is affected by death or loss, and the mouth commences activity, then the form will be expressed in melancholy sound. If the mind is affected by good fortune or love, and the mouth commences activity, then the form will be expressed in the sound of joy." Record of Music, 1527.

[41] This theory that the state of the mind is determined by the external material reality differs from earlier theories that music imitates nature, or comes from yin and yang.

[42] In the secondary annotations, these are further correlated other elements of the metaphysical system, for example earth, metal, wood, fire, and water, and varying degrees of turbidity and clarity.

[43] ANNOTATIONS: "[The five sounds] gong, shang, jiao, zhi, yu mixed together are tones (yin); coming forth separately they are called sound (sheng)." Record of Music, 1527.

[44] ANNOTATIONS: "When the sound gong is played on one musical instrument, the sound gong will resonate on the many instruments. But this is not sufficient to be music. And so it is transformed and made intricate. The Book of Changes states: 'Similar sounds resonate; similar qi seek each other.'" Record of Music, 1527; A Concordance to Yi Ching (Zhou Yi Yinde), 2/1/.

[45] ANNOTATIONS: "On the upper Pu River, there is a space in the mulberry grove. The sound of a nation in ruin emanates from the river there. In times past, Emperor Zhou of Yin ordered his musician Yan to compose decadent music. Finished, he drowned himself in the Pu River. Later the musician Juan passed there. In the night he heard it and recorded it. He later performed it for Duke Ping of Jin." Record of Music, 1528.

[46] "Juxtaposing melodies and performing [tones], and then coordinating this with shields, axes, feathers and tassels is termed music (yue)." Record of Music, 1527.

[47] The best account of this perceived decline is Ray Huang, 1587, A Year of No Significance: The Ming Dynasty in Decline (New Haven: Yale University Press, 1981).

[48] Benjamin Elman, "Political, Social, and Cultural Reproduction Via Civil Service Examinations in Late Imperial China," JAS 50 no. 1 (1991): 7-28.

[49] Elman argues that such questions became infrequent not during the Ming but during the Qing dynasty.

[50] For an analysis of proposals in 16th-century China to reform the calendar, see Willard J. Peterson, "Calendar Reform Prior to the Arrival of Missionaries at the Ming Court," Ming Studies no. 21 (1986): 45-61.

[51] Keith Pratt, "Art in the Service of Absolutism: Music at the Courts of Louis XIV and the Kangxi Emperor," Seventeenth Century 7 no. 1 (1992): 83-110.

[52] Joseph S. C. Lam, "Ritual and Musical Politics in the Court of Ming Shizong," in Harmony and Counterpoint: Ritual Music in Chinese Context, ed. Bell Yung, Evelyn S. Rawski, and Rubie S. Watson, (Stanford: Stanford University Press, 1996). Lam's account is based primarily on Zhang Juzheng's Da Ming Shizong Shuhuangdi Shilu.

[53] Lam, "Ritual and Musical Politics," 52.

[54] Lam, "Ritual and Musical Politics," 52. Lam argues, too relativistically perhaps, "Third, due to the absence of definitive and objective answers, court citizens discussing state ritual and music could advance only what they psychologically and intellectually considered 'right'" (52). Here Lam cites Lucian W. Pye, The Spirit of Chinese Politics (Cambridge: Harvard University Press, 1968), 12-35.

[55] There is no genealogy (jiapu) or chronological biography (nianpu) for Zhu. For biographical sources in English on Zhu, see "Chu Tsai-yü," in L. Carrington Goodrich and Chaoying Fang, Dictionary of Ming Biography, 1368-1644 (New York: Columbia University Press, 1976), s.v.

[56] The most comprehensive work on Zhu is Dai Nianzu's Zhu Zaiyu--Mingdai de kexue he yishu juxing (Zhu Zaiyu--A Giant in Science and the Arts during the Ming Dynasty); this work contains a bibliography of secondary works on Zhu. The most important source in Western languages is Erich F. W. Altwein and Kenneth Robinson, A critical study of Chu Tsai-yu's contribution to the theory of equal temperament in Chinese music (Wiesbaden: Steiner, 1980). See also Fritz A. Kuttner, "Prince Chu Tsai-Yü's Life and Work: A Re-evaluation of His Contribution to Equal Temperament Theory," Ethnomusicology 19.2 (1975); Joseph Marie Amiot and Pierre Joseph Roussier, Memoire sur la musique des Chinois (Geneve: Minkoff Reprint, 1973); Robert Bruce, A partial index to Encyclopedie de la musique et dictionnaire du conservatoire (1936); Alexander John Ellis and Hermann von Helmholtz, On the sensations of tone as a physiological basis for the theory of music (New York: Longmans, Green, and Co., 1895).

[57] For the debate over priority of the discovery of equal temperament, see Robinson, A Critical Study of Chu Tsai-yü's Contribution to the Theory of Equal Temperament in Chinese Music, 2-3; for criticism of Needham and Kuttner, see Dai, Zhu Zaiyu--Mingdai de kexue he yishu juxing, 303 ff. Robinson asserts that Zhu discovered the equal temperament 30 years before the discovery in Europe (3).

[58] The Yuelü quanshu is reprinted in the SKQS, CSJCCB, and WYWK; there is a rare Ming edition in the Beijing Library.

[59] See Si ku cai jin shumu, Wu Weizu ed., originally Ge sheng jin cheng shumu, (Beijing: Shangwu yinshuguan, 1960). Among the 61 bibliographies of books presented to the Si ku editors from various provinces and individuals (some bibliographies combine contributions from more than one individual), the following bibliographies list copies of Zhu's works: Liang Huai yan zheng Li cheng song shumu, 46 copies of Yue [lü quan] shu (57); Zhejiang sheng di wu ci Pu shu ting song shumu, 34 copies of Yue lü quan shu (115); Shandong xunfu di er ci cheng jin shumu lists several separate juan from Yue lü quan shu, including one copy of Yue xue suan xue xin shuo (150); Henan sheng cheng song shumu, one copy of Yue xue xin shuo Suan xue xin shou (156); Shanxi sheng cheng song shu mu lists Yue lü quan shu but does not record the numbers of copies of any of the books in the bibliography (158); Du cha yuan fu du yu shi Huang jiao chu shu mu, lists 17 copies (176); Zhejiang cai ji yi shu zong lu jian mu lists a 37 juan edition of the Yue lü quan shu (245).

[60] See Zhongguo congshu zonglu, 1:1044-5.

[61] Yue lu quan shu, 747.

[62] The date of engraving Wanli 31/8/3 is from the Suan xue xin shuo in the Yue lü quan shu Beijing tushuguan guji zhenben congkan 4 (Beijing: Shumu wenxian chubanshe, n.d.). The date has been the subject of controversy because of the debates over the priority of the discovery of equal temperament. See note nn below.

[63] In addition to the Suanxue xin shuo yi juan, extant mathematical works by Zhu Zaiyu not included in the Yue lü quan shu include Zhoubi suanjing tujie yi juan (Zhoubi Classic, illustrated and explained), in Gu jin suanxue congshu ;Yuanfang gougu tujie yi juan, in GJSXCS;Jialiang suanjing san juan wenda yi juan fanlie yi juan, in Xuan yin wan wei bie cang, and Wan wei bie cang.

[64] Se pu is included in the Bai chuan shu wu congshu.

[65] Sivin argues that "the Jesuit missionaries prompted an efflorescence of interest in European geometry, true trigonometry, logarithms, and so on. This hiatus may have been part of the price paid for by the abacus." Sivin's view is cited by John K. Fairbank as an example of "how China's early precocity in invention could later hold her back." Fairbank, China: A New History (Cambridge: Belknap Press of the Harvard University Press, 1992), 3.

[66] The following perl program, used to calculate the values in the table, succinctly demonstrates the procedure used to calculate the roots:
$x = 2;
$root[1] = 1;
PLACE: foreach $n (1..25) {
  $r = $root[$n];
  foreach $i (0..9) {
    $d = (9-$i) * 10**(-$n);
    if ($d*(2*$r+$d) <= ($x-($r)**2)) {
      $root[$n+1] = $r+$d;
      next PLACE;