New to Perl6, trying to figure out what I'm doing wrong here. The problem is a simple checksum that takes into account the max and min values for each line in csv
The return values max and min are completely erroneous. For the first line in csv, it returns max as 71, and min is 104, which is incorrect.
Here's the link in the repo for the link, and link with the corresponding problem.
#!/usr/bin/env perl6 use Text::CSV; sub checksum { my $sum = 0; my @data = csv(in => "input.csv"); for @data -> @value { $sum += (max @value) - (min @value); } say $sum; } checksum
, , CSV , . min max , max("4", "10") - 4, max("04", "10") - 10. , Numeric (int, ..), min/max:
min
max
max("4", "10")
4
max("04", "10")
10
Numeric
@input.map(*.Numeric).max
min max, , :
@input.max(*.Numeric)
, , , . : +* { +$_ } " X ", : .Numeric.
+*
{ +$_ }
.Numeric
Source: https://habr.com/ru/post/1690220/More articles:serving static files from ingress-nginx - nginxOverride styles in shadow-root element - cssimages do not line up and the text will not pass under img - htmlJest Testing Meteor React Component that uses withTracker in a container (meteor / meteor reaction data) - javascriptКак функция Meteor withTracker выполняется иначе, чем первая функция реактивного контейнера createContainer? - javascriptКривая в форме D3 - reactjsThree-way encoding, inclusive - or type Scala - scalaRandom BigFloats Julia - randomDetecting fast user switching events from an application running in an RDP session (minimizing the RDP window) - visual-c ++How to make a text field editable within 10 seconds with the click of a button? - javaAll Articles