2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,5 +1,12 @@
Programming languages often have built-in routines to convert a non-negative integer for printing in different number bases. Such common number bases might include binary, [[Octal]] and [[Hexadecimal]].
Show how to print a small range of integers in some different bases, as supported by standard routines of your programming language. (Note: this is distinct from [[Number base conversion]] as a user-defined conversion function is '''not''' asked for.)
;Task:
Print a small range of integers in some different bases, as supported by standard routines of your programming language.
;Note:
This is distinct from [[Number base conversion]] as a user-defined conversion function is '''not''' asked for.)
The reverse operation is [[Common number base parsing]].
<br><br>

View file

@ -0,0 +1,5 @@
say 30.base(2); # "11110"
say 30.base(8); # "36"
say 30.base(10); # "30"
say 30.base(16); # "1E"
say 30.base(30); # "10"

View file

@ -0,0 +1,6 @@
print asc("X") ' convert to ascii
print chr$(169) ' ascii to character
print dechex$(255) ' decimal to hex
print hexdec("FF") ' hex to decimal
print str$(467) ' decimal to string
print val("27") ' string to decimal