X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Fstdlib.psi;h=bcc884d7b9d30a6f18d310eb13d50527e3126465;hp=8a5257205e3433e9c7b404777e7f9bc14ef04ee9;hb=2454ceb434f8190937580d1cca96f5737908224e;hpb=bd765bd31d30834ca633ffc120e2fce4e49912d7 diff --git a/psi.d/stdlib.psi b/psi.d/stdlib.psi index 8a52572..bcc884d 100644 --- a/psi.d/stdlib.psi +++ b/psi.d/stdlib.psi @@ -20,3 +20,10 @@ function psi\lldiv(int $numerator, int $denominator) : array { let denominator = intval($denominator); return to_array(lldiv, to_int(quot), to_int(rem)); } + +function psi\strtold(string $str, string &$end = null) : float { + let nptr = strval($str); + let endptr = &NULL; + return to_float(strtold); + set $end = to_string(*endptr); +} \ No newline at end of file