This commit is contained in:
Vitor Santos Costa
2018-10-09 13:47:27 +01:00
parent 48e398576f
commit 9e3a768220
5 changed files with 89 additions and 79 deletions

View File

@@ -66,7 +66,11 @@ static lbfgsfloatval_t evaluate(void *instance, const lbfgsfloatval_t *x,
// Goal did not succeed
return FALSE;
}
rc = YAP_FloatOfTerm(YAP_GetFromSlot(sl));
YAP_Term o;
if (YAP_IsIntTerm((o = YAP_GetFromSlot(sl))))
rc = YAP_IntOfTerm(o);
else
rc = YAP_FloatOfTerm(o);
YAP_RecoverSlots(1, sl);
return rc;
}