From:

Date:

November 1, 2021 16:17Subject:

Re: how do I turn a real into and array of Integers?Message ID:

CANan03ZvY35bKEXS2k8wT-FdhfG9qATr7eKYPF8NMVAQL5SzOw@mail.gmail.comOn Mon, Nov 1, 2021 at 1:53 AM sisyphus <sisyphus359@gmail.com> wrote: > Note that what you have there is a 200-decimal-digit (around 658-bit) > precision representation of the square root of 2 - which is quite different > to the (53-bit precision) Real sqrt(2). > Always gotta be careful with reals. I also attempted to get the digits of the real square root of 2 using a numeric-only method: (2.sqrt, { 10 * ($_ - .truncate) } ...^ 0)>>.truncate This gives: (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1 0 1 0 6 5 7 0 0 8 7 3 7 3 2 5 6 6 8 3 3 4 9 6 0 9 3 7 5) That's a lot more digits than you see in the string representation of 2.sqrt, but checking showed that most of them--all of them after the 7-3-0-9-5---are wrong.Thread Previous | Thread Next

- how do I turn a real into and array of Integers? by ToddAndMargo via perl6-users
- Re: how do I turn a real into and array of Integers? by Andinus via perl6-users
- Re: how do I turn a real into and array of Integers? by Sean McAfee
- Re: how do I turn a real into and array of Integers? by ToddAndMargo via perl6-users
- Re: how do I turn a real into and array of Integers? by ToddAndMargo via perl6-users
- Re: how do I turn a real into and array of Integers? by Kevin Pye
- Re: how do I turn a real into and array of Integers? by ToddAndMargo via perl6-users
- Re: how do I turn a real into and array of Integers? by Sean McAfee
- Re: how do I turn a real into and array of Integers? by ToddAndMargo via perl6-users
- Re: how do I turn a real into and array of Integers? by sisyphus
**Re: how do I turn a real into and array of Integers?**by Sean McAfee- Re: how do I turn a real into and array of Integers? by Alice
- Re: how do I turn a real into and array of Integers? by Shlomi Fish
- Re: how do I turn a real into and array of Integers? by ToddAndMargo via perl6-users
- Re: how do I turn a real into and array of Integers? by Bruce Gray
- Re: how do I turn a real into and array of Integers? by sisyphus
- Re: how do I turn a real into and array of Integers? by William Michels via perl6-users
- Re: how do I turn a real into and array of Integers? by Patrick R. Michaud
- Re: how do I turn a real into and array of Integers? by William Michels via perl6-users
- Re: how do I turn a real into and array of Integers? by ToddAndMargo via perl6-users

nntp.perl.org: Perl Programming lists via nntp and http.

Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About