1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-17 14:18:13 +01:00
This commit is contained in:
Justin Lin 2022-05-03 16:37:28 +08:00
parent 1a27de190f
commit c97b5a9ed0

View File

@ -4,7 +4,7 @@ use <../split_str.scad>;
function _str_to_int(t) = ord(t) - 48;
function _parse_positive_int(t, value = 0, i = 0) =
i == len(t) ? value : _parse_positive_int(t, value * pow(10, i) + _str_to_int(t[i]), i + 1);
i == len(t) ? value : _parse_positive_int(t, value * 10 ^ i + _str_to_int(t[i]), i + 1);
function _parse_positive_number(t) =
len(search(".", t)) == 0 ? _parse_positive_int(t) :