Non-decimal radices/Input: Difference between revisions

m
(add RPL)
m (→‎{{header|Wren}}: Minor tidy)
Line 1,666:
=={{header|Wren}}==
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Conv, Fmt
 
var tests = [ ["0b1110", 2], ["112", 3], ["0o16", 8], ["14", 10], ["0xe", 16], ["e", 19] ]
for (test in tests) {
SystemFmt.print("%(Fmt.$6s in base $-2d = $s(6", test[0])) in base %(Fmt.d(-2, test[1])), = %(Conv.atoi(test[0], test[1]))")
} </syntaxhighlight>
 
9,476

edits