SLAX does automatically convert strings into numbers as required (or it tries to at least). The following code is an example of how you could achieve your objective. A mod result of 1 indicates it is odd, 0 indicates it is even:
var $interface-name-1 = "ge-0/0/1";
var $interface-name-2 = "ge-0/1/2";
var $digits-1 = translate( substring-after( $interface-name-1, "-" ), "/", "" );
var $digits-2 = translate( substring-after( $interface-name-2, "-" ), "/", "" );
<output> $digits-1 mod 2;
<output> $digits-2 mod 2;