Data update
This commit is contained in:
parent
ed705008a8
commit
0df55f9f24
2196 changed files with 32999 additions and 3075 deletions
|
|
@ -0,0 +1,28 @@
|
|||
func$ num2str n base .
|
||||
if n = 0
|
||||
return "0"
|
||||
.
|
||||
d = n mod base
|
||||
if d > 9
|
||||
d += 39
|
||||
.
|
||||
d$ = strchar (d + 48)
|
||||
if n < base
|
||||
return d$
|
||||
.
|
||||
return num2str (n div base) base & d$
|
||||
.
|
||||
func str2num s$ base .
|
||||
r = 0
|
||||
for c$ in strchars s$
|
||||
d = strcode c$ - 48
|
||||
if d > 9
|
||||
d -= 39
|
||||
.
|
||||
r = r * base + d
|
||||
.
|
||||
return r
|
||||
.
|
||||
print num2str 253 16
|
||||
print str2num "fd" 16
|
||||
print num2str 0 16
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import "/fmt" for Conv
|
||||
import "./fmt" for Conv
|
||||
|
||||
System.print(Conv.itoa(26, 16))
|
||||
System.print(Conv.atoi("1a", 16))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue