$ perl -le 'printf "%.800g\n", 0.1'
0.1000000000000000055511151231257827021181583404541015625


You can do essentially the same in python3:
$ python3 -c 'print ("%.800g" % 0.1e0)' 0.1000000000000000055511151231257827021181583404541015625
It just remains to be seen if and how the same can be achieved in raku.
I've now posted about this issue to the perl6-users list ( https://www.nntp.perl.org/group/perl.perl6.users/2021/04/msg9860.html )

Of course, we don't have to ask for 800 digits for the particular value of 0.1, as it only requires 55 significant digits. But there are some double precision values that do need more.
For example 4.4501477170144023e-308 requires 767 significant digits. I don't know of any value that requires more than 767 digits ... I'm confident (for some dubious definition of "confident") there aren't any.
The value of 4.4501477170144023e-308 can be assigned with:
C:\> perl -e "for(1022 .. 1074) { $x+= 2 ** -$_ }; printf '%.16e', $x"
I've also found that when python3 and the mpfr library compare rationals and doubles, they do so by converting the double to its exact rational value, and then compare the 2 rationals.
I haven't found any implementation (apart from raku) that converts the rational to its nearest double value, and then compares the doubles.
(I've also mentioned this in the same perl6-users thread.)

Cheers,
Rob

In reply to Re^4: [Raku] Arcane treatment of doubles and rationals by syphilis
in thread [Raku] Arcane treatment of doubles and rationals by syphilis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.