Muhammad ibn Musa al-Khwarizmi (about 780-850) worked in Baghdad in the time of al-Ma'mun. His book on calculation by completion and balancing (al-jabr wa'l-muqabala) gave us the word algebra, from al-jabr; the word algorithm comes from the Latin form of his name. His work on Indian numerals helped to spread the decimal system with the zero in the Islamic world and later in Europe. Astronomy had religious uses as well as scientific ones: fixing prayer times, the direction of prayer (qibla) and the start of the lunar months. Al-Biruni (973-after 1050) measured the radius of the Earth with a method based on the height of a mountain, and wrote about the history and sciences of many peoples. These scholars built on Greek and Indian knowledge and added their own methods, tables and proofs.