develooper Front page | perl.perl6.users | Postings from June 2022

BigRoot precision question

Thread Next
From:
ToddAndMargo via perl6-users
Date:
June 11, 2022 09:41
Subject:
BigRoot precision question
Message ID:
5ef30377-7d9b-8507-4937-b9f39949edae@zoho.com
Hi All,

In the following paper on Big Root:

https://newbedev.com/how-can-i-set-the-level-of-precision-for-raku-s-sqrt


 > use BigRoot;
 > BigRoot.precision = 7;
 > say (BigRoot.newton's-sqrt: 2;).base(10)
1.4142136
 > say (BigRoot.newton's-sqrt: 2;).base(16)
1.6A09E7

That is a base(10) precision.  In base(16) (Hex)
that is only 3 digits past the decimal.
     0x6A-0x09-0xE7

Is there a way to tell BigRoot I want a certain
amount of Hex digits I want after the decimal?

Or just ask for double I want and prune afterwards?


Many thanks,
-T



-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When you say, "I wrote a program that
crashed Windows," people just stare at
you blankly and say, "Hey, I got those
with the system, for free."
      -- Linus Torvalds
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About