Libraryless. Click here for Pure Java version (3804L/22K).
1 | static double doubleMultiMinus(Iterable<Double> l) { |
2 | var it = iterator(l); |
3 | if (!it.hasNext()) ret 0; |
4 | double x = it.next(); |
5 | while (it.hasNext()) |
6 | x -= it.next(); |
7 | ret x; |
8 | } |
9 | |
10 | static double doubleMultiMinus(double... l) { |
11 | int n = l(l); |
12 | if (n == 0) ret 0; |
13 | double x = l[0]; |
14 | for (int i = 1; i < n; i++) |
15 | x -= l[i]; |
16 | ret x; |
17 | } |
Began life as a copy of #1019131
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1032656 |
Snippet name: | doubleMultiMinus |
Eternal ID of this version: | #1032656/3 |
Text MD5: | 29974687d2643023cefe4d6ccaf289a8 |
Transpilation MD5: | b3619408b644b5cd8dc0cceebecc769d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-09-30 05:16:36 |
Source code size: | 357 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 140 / 194 |
Version history: | 2 change(s) |
Referenced in: | [show references] |