Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1024749 // floatSum

JavaX fragment (include)

1  
static float floatSum(Iterable<Float> l) {
2  
  float sum = 0;
3  
  for (Float i : unnull(l))
4  
    if (i != null) sum += i;
5  
  ret sum;
6  
}
7  
8  
static float floatSum(float... l) {
9  
  float sum = 0;
10  
  if (l != null) for (float i : l)
11  
    sum += i;
12  
  ret sum;
13  
}

Author comment

Began life as a copy of #1019131

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: #1024749
Snippet name: floatSum
Eternal ID of this version: #1024749/1
Text MD5: 6b5dca1bb5375321720f509c80baa4df
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-24 16:11:30
Source code size: 257 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 184 / 216
Referenced in: [show references]