fix bug in std where stol would return 0 for positive numbers

This commit is contained in:
Daniella / Tove 2022-03-06 15:58:37 +01:00
parent 25b9fd97ff
commit a077789685

View file

@ -139,6 +139,9 @@ func ltos {
def c0 "0" char =c0
n 0 gt not if {
"0" =s
}
while { n 0 gt } {
( ( ( n 10 _long % _char ) c0 + ) _char 1 anewput _string ) s strconcat =s
n rem =n "divide by ten to remove last digit" #
@ -168,7 +171,8 @@ func stol {
s rem =s "remove first digit" #
}
n ne -1 * _long *
ne if { n neg =n }
n
}
func char { _array 0 aget }