On 9/3/19 5:21 AM, ToddAndMargo via perl6-users wrote:
On Tue, Sep 3, 2019 at 1:15 PM ToddAndMargo via perl6-users <perl6-us...@perl.org <mailto:perl6-us...@perl.org>> wrote:

    Hi All,

    How would I print out what a 32 real value of
    11.01 (base 10) looks like in its raw
    binary form (ones and zeros)?

    Many thanks,
    -T

On 9/3/19 5:09 AM, Fernando Santagata wrote:
Is this what you need?

 > (11.01).base(2)
1011.00000011

--
Fernando Santagata



Perfect!  Thank you!

$ p6 'say (11.01).base(2)'
1011.00000011

How would I do it in reverse.  Give a base 2 number
and print it in base 10?



Wait a minute. There is no decimal point.  Only ones and zeros.
I am looking for a binary dump of what a 32 bit real variable
actually contains.

Reply via email to