Non-decimal radices/Convert: Difference between revisions
no edit summary
(Added Easylang) |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1,353:
=={{header|EasyLang}}==
<syntaxhighlight>
func$
if n = 0
return "0"
.
d = n mod
if d > 9
d += 39
.
d$ = strchar (d + 48)
if n <
return d$
.
return
.
func
r = 0
for c$ in strchars s$
Line 1,374:
d -= 39
.
r = r *
.
return r
.
print
print
print
</syntaxhighlight>
Line 3,259:
$num.base($base);
}</syntaxhighlight>
These work on any real type including integer types. There is also a build in method/function for Strings: [https://docs.raku.org/routine/parse-base parse-base].
=={{header|REXX}}==
|