Libraryless. Click here for Pure Java version (1780L/12K).
1 | static float floatAverage(int... a) { |
2 | float sum = 0; |
3 | for i over a: |
4 | sum += a[i]; |
5 | ret floatRatio(sum, l(a)); |
6 | } |
7 | |
8 | static float floatAverage(float... l) { |
9 | ret floatRatio(floatSum(l), l(l)); |
10 | } |
11 | |
12 | static float floatAverage(Collection<Float> l) { |
13 | ret floatRatio(floatSum(l), l(l)); |
14 | } |
Began life as a copy of #1010188
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1024748 |
Snippet name: | floatAverage |
Eternal ID of this version: | #1024748/1 |
Text MD5: | 10530d5f9e7c8e1b7f5d1bf078397b84 |
Transpilation MD5: | b0efcd31cb61535a51f87e2d0136fd72 |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-24 16:10:41 |
Source code size: | 300 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 207 / 290 |
Referenced in: | [show references] |