Bin given limits: Difference between revisions

→‎{{header|J}}: Use output format similar to Haskell
(→‎{{header|J}}: Simpler but more flexible solution using adverb)
(→‎{{header|J}}: Use output format similar to Haskell)
Line 875:
printBinCounts=: verb define
counts =. y
'%2d in [ <-∞, %3d = %2d)' printf ({. xcounts) , {. countsx
'>= %3d2d and < in [%3d =, %2d3d)' printf (2 ]\}.}: xcounts) ,. }.}:2 counts]\ x
'>= %3d2d in [%3d, = %2d∞]' printf ({: xcounts) , {: countsx
)</lang>
 
Line 907:
11 4 2 6 9 5 13
limits2 printBinCounts limits2 # binnedData data2
3 in [ <-∞, 14 = 3)
>= 0 14 andin <[ 14, 18 = 0)
>=44 18 andin <[ 18, 249 = 44)
>=10 249 and <in [249, 312 = 10)
>=16 312 and <in [312, 389 = 16)
>= 2 389 and <in [389, 392 = 2)
>=28 392 and <in [392, 513 = 28)
>=16 513 and <in [513, 591 = 16)
>= 6 591 and <in [591, 634 = 6)
>=16 634 and <in [634, 720 = 16)
>=59 720 in [720, = 59∞]</lang>
 
=={{header|Java}}==
892

edits