On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote:
Hi All,

What am I doing wrong here?

 > my int16 $x = 0xABCD;
-21555

 > say $x.base(16);
-5433

 > my uint16 $y = $x.uint16;
No such method 'uint16' for invocant of type 'Int'
   in block <unit> at <unknown file> line 1

Many thanks,
-T


Came up with a work around:

     my int16 $x = 0xABCD;
     my uint16 $y = $x +| 0x0000;
     say $x.base(16);
     say $y.base(16)

     -5433
     ABCD

What is the proper way?

Reply via email to