Non-decimal radices/Output: Difference between revisions

m
(Added Quackery.)
m (→‎{{header|Wren}}: Minor tidy)
 
(2 intermediate revisions by 2 users not shown)
Line 505:
10011 23 19 13 01 02
10100 24 20 14 01 03</pre>
 
=={{header|Delphi}}==
{{works with|Delphi|6.0}}
{{libheader|SysUtils,StdCtrls}}
Delphi has native support for decimal and hexadecimal output. There is much broader support for floating point output.
 
<syntaxhighlight lang="Delphi">
 
procedure ShowRadixOutput(Memo: TMemo);
var I: integer;
begin
I:=123456789;
Memo.Lines.Add('Decimal Hexadecimal');
Memo.Lines.Add('-----------------------');
Memo.Lines.Add(IntToStr(I)+' - '+IntToHex(I,8));
end;
 
</syntaxhighlight>
{{out}}
<pre>
Decimal Hexadecimal
-----------------------
123456789 - 075BCD15
 
</pre>
 
 
=={{header|E}}==
Line 1,686 ⟶ 1,712:
ABCD
FFFFFFFF
</pre>
 
=={{header|RPL}}==
Unsigned integers are displayed in binary, octal, decimal or hexadecimal base depending on the state of 2 user flags, which can be easily configured by using resp. the <code>BIN</code>, <code>OCT</code>, <code>DEC</code> or <code>HEX</code> instruction. It is not possible to display several numbers in different bases simultaneously, unless you "freeze" their appearance by converting them to a string:
#314 DUP BIN →STR " " +
OVER OCT →STR + " " +
OVER DEC →STR + " " +
OVER HEX →STR +
{{out}}
<pre>
1: "# 100111010b # 472o # 314d # 13Ah"
</pre>
 
Line 1,879 ⟶ 1,916:
{{libheader|Wren-fmt}}
Wren has no non-decimal number conversions in its standard library so this uses a module I wrote myself to reproduce the Haskell table.
<syntaxhighlight lang="ecmascriptwren">import "./fmt" for Conv, Fmt
 
System.print(" 2 7 8 10 12 16 32")
9,476

edits