Re: print hex?

2019-02-07 Thread Todd Chester via perl6-users




On 2/7/19 11:22 AM, Curt Tilmes wrote:
On Thu, Feb 7, 2019 at 2:14 PM ToddAndMargo via perl6-users 
mailto:perl6-users@perl.org>> wrote:


What is the easiest way to get both print and say to print $i below
in Hex?

$ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x; say $i;'

Buf:0x
23982


say $i.base(16)




Hi Curt,

   A thing of beauty!  Thank you!

-T

$ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x; say 
$i.base(0x10); print $i.base(16) ~ "\n"'


Buf:0x
5DAE
5DAE


Re: print hex?

2019-02-07 Thread Curt Tilmes
On Thu, Feb 7, 2019 at 2:14 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> What is the easiest way to get both print and say to print $i below in Hex?
>
> $ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x; say $i;'
>
> Buf:0x
> 23982


say $i.base(16)


print hex?

2019-02-07 Thread ToddAndMargo via perl6-users

Hi All,

What is the easiest way to get both print and say to print $i below in Hex?

$ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x; say $i;'

Buf:0x
23982

Many thanks,
-T