Artifact 6328445c69b877f60b36ec147e9844aa6716e4ca
- File
lib/geo/pythagoras.cpp
- 2013-12-05 00:28:44 - part of checkin [64a27e41ea] on branch trunk - Pythagoras generator (user: kinaba) [annotate]
// Enumerate coprime pythagoras triangles for(int m=1;; ++m) for(int n=1; n<m; ++n) if(((m^n)&1) && gcd(m,n)==1) { int a = m*m-n*n, b = 2*m*n, c = m*m+n*n; if(a>b) swap(a,b); }