mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
WIP
This commit is contained in:
parent
9c197965b3
commit
c599dbb62a
1 changed files with 10 additions and 0 deletions
10
runtime.c
10
runtime.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue