shouldn't the initial setting of %z be $calc($1 / $2) ?