Consider the quadratic field and the associated ring of integers , where if and if . We assume is principal but not necessarily Euclidean. We compute the GCD of two elements , of modulo a unit of . The computation also gives explicit coefficients , for the Bézout identity . This is done by reducing binary quadratic forms and considering the sum of ideals as the ideal , with .