$ 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