Non-decimal radices/Output: Difference between revisions
Content added Content deleted
(Added PicoLisp) |
(→{{header|PureBasic}}: Added PureBasic) |
||
Line 445: | Line 445: | ||
"Base 16: " + ("{0:X}" -f $n) |
"Base 16: " + ("{0:X}" -f $n) |
||
}</lang> |
}</lang> |
||
=={header|PureBasic}== |
|||
<lang PureBasic>For i=105 To 115 |
|||
Bin$=RSet(Bin(i),8,"0") ;- Convert to wanted type & pad with '0' |
|||
Hex$=RSet(Hex(i),4,"0") |
|||
Dec$=RSet(Str(i),3) |
|||
PrintN(Dec$+" decimal = %"+Bin$+" = $"+Hex$+".") |
|||
Next</lang> |
|||
<tt> |
|||
105 decimal = %01101001 = $0069. |
|||
106 decimal = %01101010 = $006A. |
|||
107 decimal = %01101011 = $006B. |
|||
108 decimal = %01101100 = $006C. |
|||
109 decimal = %01101101 = $006D. |
|||
110 decimal = %01101110 = $006E. |
|||
111 decimal = %01101111 = $006F. |
|||
112 decimal = %01110000 = $0070. |
|||
113 decimal = %01110001 = $0071. |
|||
114 decimal = %01110010 = $0072. |
|||
115 decimal = %01110011 = $0073.</tt> |
|||
=={{header|Python}}== |
=={{header|Python}}== |