Medieval and early modern mathematics