Libraryless. Click here for Pure Java version (3809L/22K).
1 | static double doubleMultiRatio(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 = doubleRatio(x, it.next()); |
7 | ret x; |
8 | } |
9 | |
10 | static double doubleMultiRatio(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 -= doubleRatio(x, l[i]); |
16 | ret x; |
17 | } |
Began life as a copy of #1032656
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1032657 |
| Snippet name: | doubleMultiRatio |
| Eternal ID of this version: | #1032657/1 |
| Text MD5: | 5e76b7f626c0e8ad52c73b0e24b4447d |
| Transpilation MD5: | f72b09320c25e65a8b5fc5113679af8c |
| 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:44 |
| Source code size: | 388 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 404 / 530 |
| Referenced in: | [show references] |