egallesio / STklos

STklos Scheme
http://stklos.net
GNU General Public License v2.0
69 stars 17 forks source link

Fix typo in `gcd2` which was allowing arbitrary types (not just integer numbers) as arguments. (One-liner) #551

Closed jpellegrini closed 1 year ago

jpellegrini commented 1 year ago

Hi @egallesio !

stklos> (gcd 10 'a)
0
stklos> (gcd 'a 10)
**** Error:
gcd: exact or inexact integer required, got a

Oh, that is because:

  if (STk_integerp(n1) == STk_false) error_not_an_integer(n1);
  if (STk_integerp(n1) == STk_false) error_not_an_integer(n2);
                   ^^
                   ^^

Oops.. Fixed!

egallesio commented 1 year ago

Thanks @jpellegrini.