develooper Front page | perl.perl6.users | Postings from October 2021

how do I turn a real into and array of Integers?

Thread Next
From:
ToddAndMargo via perl6-users
Date:
October 31, 2021 06:58
Subject:
how do I turn a real into and array of Integers?
Message ID:
f22e5bdb-6706-4e40-573c-a0a002a2c993@zoho.com
Hi All,

Without going into why (it is a secret), how do I turn

 > my $x = sqrt 2
1.4142135623730951

into an array of integers?
@y[0] = 1
@y[1] = 4
@y[2] = 1
@y[3] = 4
@y[4] = 2
@y[5] = 1

etc.


Many thanks,
-T



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