 It appears in Euclid's "Elements" (c. 300 BC), specifically in Book 7 (Propositions 1–2) and Book 10 (Propositions 2–3).In Book 7, the algorithm is formulated for integers, whereas in Book 10, it is formulated for lengths of line segments.