Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
justinethier committed Nov 16, 2023
1 parent 9c19796 commit c599dbb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,16 @@ int str_is_bignum(str2int_errno errnum, char *c)
return 1;
}

float string2rational(char *s){
{
// TODO: this is terrible, needs work:
char *nom = _strdup(s);
char *denom = strchr(s, '\');
denom[0] = '\0';
denom++;
return strtol(nom, NULL, 10) / strtol(denom, NULL, 10);
}

object Cyc_string2number_(void *data, object cont, object str)
{
int result, rv;
Expand Down

0 comments on commit c599dbb

Please sign in to comment.