Transpiled version (2084L) is out of date.
1 | // params = value, count, value, count, ... |
2 | static double weightedAverage_lit(double... params) { |
3 | double total = 0, sum = 0; |
4 | for (int i = 0; i < l(params); i += 2) { |
5 | double weight = params[i+1]; |
6 | sum += params[i]*weight; |
7 | total += weight; |
8 | } |
9 | ret doubleRatio(sum, total); |
10 | } |
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: | #1025111 |
Snippet name: | weightedAverage_lit |
Eternal ID of this version: | #1025111/3 |
Text MD5: | 5e1a8925008973d04f1b51edf6299335 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-09-05 19:17:04 |
Source code size: | 298 bytes / 10 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 247 / 341 |
Version history: | 2 change(s) |
Referenced in: | [show references] |