I'm still pretty new to LaTeX and TeX. I came across this equation on GCD.
I wanted to note it down. So, I wrote the equation like this:
\begin{equation*}
gcd(a,b)=
\left\{\begin{array}{lr}
a, & b=0\\
gcd(b, a % b) , & b \neq 0
\end{array}\right.
\end{equation*}
But no matter how hard I try, I always get this:
Can anyone help?


\%– Luis Turcio Jun 04 '23 at 02:10%is TeX's comment character, and TeX ignores everything afterward. Somewhat like#or//in some programming languages. – Teepeemm Jun 04 '23 at 18:01