New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.roll on a Range of Num ain't random #4759
Comments
From @gfldex(0.1 .. 0.3).roll(10).say; # OUTPUT«(0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1)» # It should either be random or warn/fail at compile time. |
From @lizmat
What did you expect? a selection of 0.1, 0.2, 0.3 ?? or 10 random values between 0.1 and 0.3 inclusive? Liz |
The RT System itself - Status changed from 'new' to 'open' |
From @gfldexOn Thu, 26 Nov 2015, Elizabeth Mattijsen via RT wrote:
I would (naive) expect 10x a value between 0.1 and 0.3 . Analog to: (0.1, 0.2, 0.3).roll(10).say; However, S03 is quite clear how Range is iterating. 0.1.succ == 1.1; So incrementing by 0.1 can't work. It may be reasonable to fail as early mfgwp |
From @moritzOn 11/26/2015 03:36 PM, Wenzel P. P. Peppmeyer wrote:
I don't think so. What's wrong with (1.1 .. 10.1).roll for example? It People need to read docs occasionally, there's nothing we can do to Cheers, |
From @pmichaudThe standard meaning of ".roll" is to randomly select elements If the intent is to select from the values 0.1, 0.2, 0.3, I'd expect (0.1, 0.2, 0.3).roll(6) If the intent is to select from a range of values incrementing by (0.1, 0.2 ... 10.1).roll(6) If the intent is to generate six random Num values from a Range, (0.1 .. 0.3).rand xx 6 Pm On Thu, Nov 26, 2015 at 03:36:49PM +0100, Wenzel P. P. Peppmeyer wrote:
|
From @lizmatSo implemented with 61ea661d8dfc04acabf1eb46c Liz
|
From @cokeOn Fri Nov 27 09:22:20 2015, elizabeth wrote:
17:37 [Coke] lizmat: you last touched https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126664 - is that closable now? marking testneeded. |
From @zoffixznetTests added in Raku/roast@26def41e43 and in Raku/roast@6cf1522191 |
@zoffixznet - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#126664 (status was 'resolved')
Searchable as RT126664$
The text was updated successfully, but these errors were encountered: